MySQL Query ORDER Defines Some Values โ€‹โ€‹Before Others

I am developing a game record where the completion time is stored in the database, but if you have not reached the level, but save your record, the completion time is 0.

I am trying to make a request that first lists the recorder with the shortest completion time, but my simple ORDER BY at the beginning of the course sticks to all 0 times over and over again!

Is there a way that I can order it like this, but I have 0 at the bottom.

I tried:

SELECT FROM highscores ORDER BY completiontime > 0, completiontime = 0 ASC

Does anyone have any ideas?

+4
source share
1 answer
 SELECT * FROM highscores ORDER BY completiontime = 0, completiontime 
+8
source

All Articles