I am trying to sort by multiple columns in SQL, and in different directions.
(我试图按SQL中不同方向的多个列进行排序。)
column1
column2
(column1将按降序排序,而column2将按升序排序。)
How can I do this?
(我怎样才能做到这一点?)
ORDER BY column1 DESC, column2
每当两行或更多行的column1字段相等时,这将首先按column1 (降序)对所有内容进行排序,然后按column2 (升序,这是默认设置)对所有内容进行排序。
2.1m questions
2.1m answers
60 comments
56.9k users