I want to sort some table data but with a custom order:
I want to show 2nd result at first, then 1st, then 3rd, 4th etc.
This is part of my query:
SELECT order FROM table ORDER BY order DESC LIMIT 0
It will give me values like 8, 6 , 5 , 3 , 2 , 1
but I need to get 6, 8 , 5 , 3 , 2 , 1 (second result becomes first)
And those values (8, 6 , 5 ….) will never be same.
How can I do this?
P.S: it is hosted on godaddy, so I’m not sure defining a custom function would work and I’m using CodeIgniter if that would help.
You can UNION three querys: