I have a mySQL data set like this:
id | name | country_id | sort |
-------------------------------------------------
0000001 Name A 2001 29.90
0000002 Name B 2929 90.02
0000003 Name C 2001 99.50
0000004 Name D 2001 42.03
0000005 Name E 2929 62.49
0000006 Name F 1005 78.00
Normally, I would do an ORDER BY sort DESC
and then I'd get a result like:
0000003 Name C 2001 99.50
0000002 Name B 2929 90.02
0000006 Name F 1005 78.00
0000005 Name E 2929 62.49
0000004 Name D 2001 42.03
0000001 Name A 2001 29.90
Now, what I'd like to do is show the results of country_id 2929
first, also ordered by sort DESC
, followed by the other results in the sort DESC
order as they would if there was no country_id
order before.
How would I achieve that? So basically the order should be:
0000002 Name B 2929 90.02
0000005 Name E 2929 62.49
0000003 Name C 2001 99.50
0000006 Name F 1005 78.00
0000004 Name D 2001 42.03
0000001 Name A 2001 29.90