如何根据多列获取排序后的输出?
我们可以指定 ORDER BY 子句中的多列,以基于这些多列获取排序后的输出。作为示例,以使此概念更清晰 −
mysql> Select * from Student ORDER BY Name, Address; +------+---------+---------+-----------+ | Id | Name | Address | Subject | +------+---------+---------+-----------+ | 2 | Aarav | Mumbai | History | | 1 | Gaurav | Delhi | Computers | | 15 | Harshit | Delhi | Commerce | | 17 | Raman | Shimla | Computers | +------+---------+---------+-----------+ 4 rows in set (0.12 sec)
广告