I want to print the trending row first and then New and then all other row from the table "employee".
Also i want limit the number of row and in descending order
I was trying this
SELECT * FROM (SELECT * FROM employee LIMIT 7) sub ORDER BY id DESC
Expected Result
You may try ordering with a CASE
expression:
SELECT id, Name, Status
FROM employee
ORDER BY
CASE Status WHEN 'Trending' THEN 1
WHEN 'NEW' THEN 2
ELSE 3 END,
id DESC
LIMIT 7;