cridley
07-05-2006, 10:57 AM
Here goes...
1st table: users
fields : userID, userName
2nd table : response
fields : respID, userID, verified
in users, each userID is unique, in response there are many respID entries per userID, some of which are verified (value 1), the rest of which are not (value 0).
I am looking for a query to return something in the following format (have tried using count and can't quite get to the desired result):
userID | username | total n#ofentries | verified=0 | verified=1
foruser
1 | bob | 5 | 2 | 3
2 | frank | 4 | 3 | 1
3 | John | 10 | 3 | 7
Where each user appears once, followed by total number of responses, followed by number of verified responses, followed by number of unverified responses.
How?
Thanks in advance,
C.
1st table: users
fields : userID, userName
2nd table : response
fields : respID, userID, verified
in users, each userID is unique, in response there are many respID entries per userID, some of which are verified (value 1), the rest of which are not (value 0).
I am looking for a query to return something in the following format (have tried using count and can't quite get to the desired result):
userID | username | total n#ofentries | verified=0 | verified=1
foruser
1 | bob | 5 | 2 | 3
2 | frank | 4 | 3 | 1
3 | John | 10 | 3 | 7
Where each user appears once, followed by total number of responses, followed by number of verified responses, followed by number of unverified responses.
How?
Thanks in advance,
C.