I have a MySQL table, setup like this:
id | game_type | votes
01 | aaa | 2
02 | bbb | 2
03 | ccc | 4
04 | aaa | 7
05 | aaa | 1
06 | ccc | 11
I would like to return all the rows, so they are ordered by game_type, but with the most occurrences of game type in descending order, AND THEN ordered by the amount of voted in descending order, like this:
04 aaa 7
01 aaa 2
05 aaa 1
06 ccc 11
03 ccc 4
02 bbb 2
If I just have the ORDER BY at the end of the query, it just groups them in a random order.
How could I achieve this?
Try this: