Order by的几种用法
编辑: 面试啦 发布时间: 2024-01-05 18:17:08
1. 按列名排序,默认是升序的。
单列升序:select from order by ;
单列降序:select from table_name order by desc;
多列升序:select, from table_name order by , ;
多列降序:select, from order by desc, desc;
多列混合降序:select column_one, column_two from table_name order by column_one desc, column_two desc;
2. 按列的位序排序, 默认是升序
select * from order by 1
3. NULL排序
空值在前:select from order by NULLS FIRST;
空值在后:select from order by NULLS LAST;
单列升序:select
单列降序:select
多列升序:select
多列降序:select
多列混合降序:select column_one, column_two from table_name order by column_one desc, column_two desc;
2. 按列的位序排序, 默认是升序
select * from
3. NULL排序
空值在前:select
空值在后:select
面试题库导航
- C++面试题
- JAVA面试题
- Oracle面试题
- MySQL面试题
- Linux面试题
- 网络工程师面试题
- 网管面试题
- 软件工程师面试题
- PHP面试题
- .net面试题
- 软件测试面试题
- EJB面试题
- Spring面试题
- Javascript面试题
- Python面试题
- QTP面试题
- Servlet面试题
- J2EE面试题
- Database面试题
- ASP面试题
- Unix面试题
- Loadrunner面试题
- 通信面试题
- 嵌入式面试题
- Ruby面试题
- Delphi面试题
- Mobile开发面试题
- SOA面试题
- JAVA面试题面试题
- 研发工程师面试题
- 软件架构师面试题
- 系统工程师面试题
- Android面试题
- JAVA程序员
- C#面试题