雅安论坛

标题: mysql倒序降序升序排列事项方法 [打印本页]

作者: 匿名    时间: 2021-5-18 23:14
标题: mysql倒序降序升序排列事项方法
mysql倒序降序升序排列事项方法
通过 ”order by“实现,语法 :order by  字段  asc/desc。
sql:select *  from tablename  order by id desc;
解释:上面语句的意思就是根据”id字段“排序,倒叙输出tablename表中的数据。
备注:asc是表示升序,desc表示降序。






欢迎光临 雅安论坛 (https://www.yaanbbs.net/) Powered by Discuz! X3.4