美文网首页
mysql 按字段排序

mysql 按字段排序

作者: 木栈桥上 | 来源:发表于2017-11-09 22:18 被阅读0次

MySql中,升序为asc,降序为desc。例如:
升序:select * from 表名 order by 表中的字段 asc(mysql中默认是升序排列,可不写)
降序:select * from 表名 order by 表中的字段 desc
若要进行同时一个升序,一个降序,则如下:
order by 升序字段 asc,降序字段 desc。

相关文章

网友评论

      本文标题:mysql 按字段排序

      本文链接:https://www.haomeiwen.com/subject/rexvmxtx.html