I have orders table like this:
OID CID ODATE 1 1 01/01/21 2 2 01/02/21 3 2 20/01/21 4. 3. 20/01/21 5. 4. 20/01/21
I want to see all the orders of cid 2 first then all the others
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
You may order using a
SELECT * FROM yourTable ORDER BY CASE CID WHEN 2 THEN 1 ELSE 2 END;
You may also add more sorting levels after the above