Order by的几种用法
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 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;
【Order by的几种用法】相关文章
2. 如何反序的迭代一个序列?how do I iterate over a sequence in reverse order
4. 软件测试LoadRunner面试题:What is the difference between standard log and extended log?
5. XML文档定义有几种形式?它们之间有何本质区别?解析XML文档有哪几种方式?
7. 说说你所熟悉或听说过的j2ee中的几种常用模式?及对设计模式的一些看法
8. EJB的几种类型
10. strlen的几种不同实现方法
本文来源:https://www.mianshiwenti.com/a13296.html
进入下载页面
﹝Order by的几种用法﹞相关内容
- 软件测试LoadRunner面试题:If web server, database and Network are all fine where could be the problem?
- Java Servlet API中forward() 与redirect()的区别
- 为什么group by 和order by会使查询变慢
- super关键字的用法
- 介绍一下Python中webbrowser的用法
- Overload和Override的区别。Overloaded的方法是否可以改变返回值的类型
- 软件测试LoadRunner面试题:What is the difference between Overlay graph and Correlate graph?
- 软件测试LoadRunner面试题:What do vuser_init action and vuser_end action contain?
- 软件测试LoadRunner面试题:How did you find web server related issues?
- Discard Protocol抛弃协议的作用是什么