SQL排序
Posted 薛小生
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL排序相关的知识,希望对你有一定的参考价值。
Order by:
升序是asc ,降序是desc
默认是升序排序:
按照name排序:
select * from user where age>18 order by name
order by 排序默认是升序排序
上述的SQL语句等同于 select * from user where age >18 order by name asc
升序:
select * from user where address=‘河北‘ order by age asc
id | name | address | age |
1 | zhangsan | 河北 | 19 |
3 | zhaofeng | 河北 | 20 |
4 | liangru | 河北 | 21 |
以上是关于SQL排序的主要内容,如果未能解决你的问题,请参考以下文章