I am developing a game highscore where the time of completion is stored in a database, but if you don't complete the level but save your highscore, the completion time is 0.
I am trying to make a query which lists the highscore with the lowest completion time first, but my simple ORDER BY
is sticking all of the 0 completion times at the start of course!
Is there any way I can order it like this, but have the 0's at the bottom.
I have tried:
SELECT FROM highscores ORDER BY completiontime > 0, completiontime = 0 ASC
Anyone have any ideas?
SELECT *
FROM highscores
ORDER BY completiontime = 0, completiontime
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With