This is kind of hard to describe, but I'll do my best. Assume you have a class registration table with the important fields being
RegID is the unique identifier for each row, ClassID is the ID number for the class, RegStatus shows if the registrant is registered (1), on a wait list (2), or not registered at all (0). What I need to do is get a list of the classes with how many users are registered and wait listed. For example:
The type of output I'm looking for is:
Basically, I need to know how many 1's and how many 2's there are in the RegStatus column for each ClassID. I could've swore I've done this before, but for some reason I seem to be pulling my hair out on this..
- RegID - Autoincrement
- ClassID - non-unique integer
- RegStatus - non-unique integer
RegID is the unique identifier for each row, ClassID is the ID number for the class, RegStatus shows if the registrant is registered (1), on a wait list (2), or not registered at all (0). What I need to do is get a list of the classes with how many users are registered and wait listed. For example:
Code:
RegID -- ClassID -- RegStatus
-------------------------------------
1 1 1
2 1 1
3 2 1
4 1 2
5 3 1
5 3 2
The type of output I'm looking for is:
Code:
ClassID -- Registerd -- WL
1 3 1
2 1 0
3 1 1
Basically, I need to know how many 1's and how many 2's there are in the RegStatus column for each ClassID. I could've swore I've done this before, but for some reason I seem to be pulling my hair out on this..