How do I return rows with a specific value first?
If your SQL dialect is intelligent enough to treat boolean expressions as having a numeric value, then you can use:
SELECT *
FROM `Users`
ORDER BY (`city` = 'New York') DESC, `city`
On SQL Server, Oracle, DB2, and many other database systems, this is what you can use:
ORDER BY CASE WHEN city = 'New York' THEN 1 ELSE 2 END, city
My answer may be old and not required but someone may need different approach,hence posting it here.
I had same requirement implemented this, worked for me.
Select * from Users
ORDER BY
(CASE WHEN city = 'New York' THEN 0 ELSE 1 END), city
GO
PS
this is for SQL