mysql conditional sort

One approach to this uses the sign() function:

order by sign(score) desc, score asc

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top