I'm wondering how to write this query, it's a little complicated...
This is an example of what's being stored in the table:
KID Utype Qtype Qname Resp UID
Q24-YYY Case T001 HM-99678 N8944 2455
Q24-YYY Case T001 HM-99678 N8944 9874
Q24-YYY Case F099 HM-99678 N8944 6554
Q24-YYY Case F099 HM-99678 SD789 2331
Q24-YYY Case F099 HM-99678 SD789 1772
Q24-YYY Case T001 HM-99678 PX667 8897
Q24-YYY Case F099 HM-99678 PX667 4412
Q24-YYY Case F099 HM-99678 SD789 6643
Q24-YYY Case F099 HM-99678 PX667 3221
Q24-YYY Case T001 HM-99678 SD789 6337
What I'm trying to do is to first, group it by the Resp column, then by the Qtype column, and add a count column for the Resps... So that, the result looks like this:
KID Utype Qtype Qname Resp COUNT
Q24-YYY Case T001 HM-99678 N8944 2
Q24-YYY Case F099 HM-99678 N8944 1
Q24-YYY Case T001 HM-99678 SD789 1
Q24-YYY Case F099 HM-99678 SD789 3
Q24-YYY Case T001 HM-99678 PX667 1
Q24-YYY Case F099 HM-99678 PX667 2
I've been playing with various iterations using group by, but so far, I get invalid group column errors and such...