May 2020
Beginner
564 pages
14h 9m
English
You can also use the ORDER BY clause with GROUP BY. It will need to be placed after the GROUP BY clause, as shown in the following query:
USE lahmansbaseballdb; SELECT playerid, teamidFROM battingWHERE playerid = 'aardsda01'GROUP BY teamid, playerid ORDER BY playerid, teamid;
The following screenshot shows the results of running the previous query:

Here, you can see that the results are now ordered by playerid and teamid.
Read now
Unlock full access