The Tricky.net

mySQL



GROUP BY vs ORDER BY

Lately, when I was designing a query for a website, I was wondering about the exact difference between group by and order by in a query. The easiest explanation is that order by is doing the sorting of a table and the group by clause is used for aggregation of a field. Ok, this is for the theory, let's see an example:


The following table contains the items bought by several people last week:

Read more...
 
<< Start < Prev 1 2 3 4 Next > End >>

Page 2 of 4