Say I have a table for students attending school like this:
St_ID |St_Name|Class_ID|Year
------+-------+--------+----
02345|John | 345|2011
07871|Jane | 234|2010
and so on.
I wish to run queries on each Class which I can get by concatenating Class_ID & Year.
i.e 345-2011 is one class
How do I do count(*), by having the concatenated string in the Group by query?
Two options:
1) Add the concatenated column to the group by clause
Eg.
2) Add each column that apart’s the concatenated column in the group by seperately
Eg.