SQL多列排序我试图按SQL中的多个列以及不同的方向进行排序。column1将按降序排序,并且column2上升。我该怎么做?
3 回答
江户川乱折腾
TA贡献1851条经验 获得超5个赞
ORDER BY column1 DESC, column2
column1
column2
column1
有只小跳蛙
TA贡献1824条经验 获得超8个赞
FirstName | LastName | YearOfBirth---------------------------------------- Thomas | Alva Edison | 1847 Benjamin | Franklin | 1706 Thomas | More | 1478 Thomas | Jefferson | 1826
SELECT * FROM People ORDER BY FirstName DESC, YearOfBirth ASC
FirstName | LastName | YearOfBirth---------------------------------------- Thomas | More | 1478 Thomas | Jefferson | 1826 Thomas | Alva Edison | 1847 Benjamin | Franklin | 1706
添加回答
举报
0/150
提交
取消