Take the tour ×  I understand the point of group by x  But how
does group by x, y work and what does it mean?  share|improve
this question is that in sql syntax? –  hallie Mar 10 '10 at
23:20 You won't find it described as this question poses it. The
GROUP BY clause can take one or more fields. GROUP BY customer;
GROUP BY lastname, firstname; GROUP BY year, store, sku etc. – 
Bill Mar 10 '10 at 23:32 add comment  1 Answer  up vote 183 down
vote accepted  "Group By X" means "put all those with the same
value for X in the one group.  "Group By X, Y" means "put all
those with the same values for both X and Y in the one group."
To illustrate using an example, let's say we have the following
table, to do with who is attending what subject at a university:
Table: Subject_Selection  Subject   Semester   Attendee ITB001
1          John ITB001    1          Bob ITB001    1
Mickey ITB001    2          Jenny ITB001    2          James
MKB114    1          John MKB114    1          Erica  When you
use a gro