我们可以在 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)
以上是我们如何获得基于多列的排序输出?的详细内容。更多信息请关注PHP中文网其他相关文章!