您好,欢迎访问一九零五行业门户网

我们如何对 MySQL 输出进行升序排序?

如果我们想按升序对结果集进行排序,需要在 order by 子句中指定 asc(ascending 的缩写)关键字。
语法select column1, column2,…,column from table_name order by column1[column2,…] asc;
示例在下面的示例中,我们按“name”列对结果集进行升序排序。
mysql> select * from student order by name asc;+------+---------+---------+-----------+| 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.00 sec)
以上就是我们如何对 mysql 输出进行升序排序?的详细内容。
其它类似信息

推荐信息