Reputation: 1391
id rank
5 1
3 2
4 3
1 0
2 0
6 0
This results : rank = 0
after rank > 0
I don't kwow how to use SQL ORDER BY
sorting results
Upvotes: 1
Views: 299
Reputation: 255015
SELECT *
FROM mytable
ORDER BY IF(rank > 0, 0, 42),
rank
Where 42
is any positive number. I've choosen 42 just because it is http://en.wikipedia.org/wiki/Answer_to_the_Ultimate_Question_of_Life,_the_Universe,_and_Everything
Upvotes: 6