I am looking to do an order by in a certain order. I know I can modify the entire database but I would then need to modify the entire code base.
What I am have, is a column in a table ‘games’ called ‘status’.
So…
SELECT *
FROM games
ORDER BY status ASC -- Will retrieve results going from 0 then 1 then 2
What I am looking for is to be able to order it by 1 then 0 then 2.
Any ideas???
If I understand correctly, using a CASE expression:
Using FIND_IN_SET function:
Using FIELD function: