id
----
0
2
1
3
7
1
6
3
1
I want to sort the id
value in descending order by using ORDER BY
in MySQL.
But if id
value equals 3
, always put it to the bottom.
The result will be like:
id
----
7
6
2
1
1
1
0
3
3
How should I do?
My try:
SELECT id FROM `table` ORDER BY CASE WHEN id='3' THEN ??? END, id DESC
What should the question marks be?