Hello all, ok I want to query mySQL database for my web site. I have the columns StaffID, CallID and status in the DB. Status is either open or closed. StaffID is a list off all users, and finally callID is the call number they closed i.e. whether they closed call 1 or call 2 etc.
So in my DB there is repeating staffIDs as they can close more than one call. For example:
CallID Status StaffID
1 Open JBloggs
2 Closed JJones
3 Closed JJones
4 Closed Howen
What I want is to query the DB and say. "List off all the staffids and the number of calls they have closed" This therefore will list all there names in order of the number of calls they have closed e.g.
StaffID
JJones 2
HOwen 1
JBloggs 0
Any ideas how to do this as I am completely out of ideas! thanks, this will be really useful to me! cheers!
So in my DB there is repeating staffIDs as they can close more than one call. For example:
CallID Status StaffID
1 Open JBloggs
2 Closed JJones
3 Closed JJones
4 Closed Howen
What I want is to query the DB and say. "List off all the staffids and the number of calls they have closed" This therefore will list all there names in order of the number of calls they have closed e.g.
StaffID
JJones 2
HOwen 1
JBloggs 0
Any ideas how to do this as I am completely out of ideas! thanks, this will be really useful to me! cheers!