mysql> select * from student order by class desc,score desc;
+----+-------+-------+-------+
| id | name | class | score |
+----+-------+-------+-------+
| 6 | user | 2 | 108 |
| 7 | user1 | 2 | 90 |
| 8 | user | 2 | 24 |
| 1 | user1 | 1 | 100 |
| 5 | user1 | 1 | 100 |
| 3 | user1 | 1 | 80 |
| 4 | user | 1 | 62 |
| 2 | user | 1 | 45 |
+----+-------+-------+-------+
8 rows in set (0.00 sec)

sql语句默认排序是升序,要以哪个字段排序,就order by 字段 desc 。就是这么简单。以班级和分数排序,都降序!