我們可以在 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)
登錄后復制
以上就是我們如何獲得基于多列的排序輸出?的詳細內容,更多請關注www.92cms.cn其它相關文章!