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
More Related Contents:
- Sort by column ASC, but NULL values first?
- SQL multiple column ordering
- MySQL: Alternatives to ORDER BY RAND()
- PostgreSQL DISTINCT ON with different ORDER BY
- ORDER BY the IN value list
- SQL best practice to deal with default sort order
- How to order by with union in SQL?
- SQL Query – Using Order By in UNION
- Optimize query with OFFSET on large table
- How to use DISTINCT and ORDER BY in same SELECT statement?
- sql ORDER BY multiple values in specific order?
- Sorting null values after all others, except special
- SQL (ORACLE): ORDER BY and LIMIT [duplicate]
- How to use SQL Order By statement to sort results case insensitive?
- Can I do a max(count(*)) in SQL?
- How to update and order by using ms sql
- SQL Server UNION – What is the default ORDER BY Behaviour
- Sort NULL values to the end of a table
- PostgreSQL ORDER BY issue – natural sort
- Why do NULL values come first when ordering DESC in a PostgreSQL query?
- Alphanumeric sorting with PostgreSQL
- Sorting string column containing numbers in SQL?
- “Order By” using a parameter for the column name
- Custom Order in Oracle SQL
- SQL for ordering by number – 1,2,3,4 etc instead of 1,10,11,12
- SQLite Order By Date1530019888000
- how does SELECT TOP works when no order by is specified?
- SQL ORDER chars numerically
- Dynamic order direction
- Curious issue with Oracle UNION and ORDER BY