MySQL follows ANSI SQL. However, there are two differences the way GROUP BY works in MySQL and ANSI SQL.
- In ANSI SQL you must group by all columns you specifies in the SELECT clause. MySQL does not have this restriction. You can have additional columns in the SELECT clause that are not in the GROUP BY clause.
- MySQL also allows you to sort the group order in which the results are returned. The default order is ascending.
If you want to see the result of the query above in the descending order, you can do it as follows:
0 comments:
Post a Comment