How can I sort by multiple columns in SQL and in different directions. column1 would be sorted descending, and column2 ascending.
column1
column2
ORDER BY column1 DESC, column2
This sorts everything by column1 (descending) first, and then by column2 (ascending, which is the default) whenever the column1 fields for two or more rows are equal.
2.1m questions
2.1m answers
60 comments
57.0k users