按第一列排序,然后按第二列排序

时间:2016-07-05 10:46:32

标签: mysql sql phpmyadmin sql-order-by

我有一张这样的表:

33-(-10)= 43

我喜欢这样的结果(首先我按年龄排序表,然后按点数订购每个年龄段):

Age | Points
-------
22  | 5000   
15  | 100
22  | 45
14  | 50
13  | 10
12  | 500
11  | 356
15  | 25

如何通过SQL实现?

4 个答案:

答案 0 :(得分:2)

select * from your_table
order by age desc, points desc

答案 1 :(得分:1)

select * 
from TableName
order by Age desc, Points desc

答案 2 :(得分:0)

使用order by clause

select * from TABLE 
order by age ,points desc

答案 3 :(得分:0)

select * 
from TableName
order by Age desc, Points desc