Oracle 排序之NUll值的排序
Jun 07, 2016 pm 05:22 PM在Oracle官方文档中说明,null值在排序过程是个比较特殊的值类型,默认情况下排序时把它看成了最大值了,也就是说在排序的时候,
背景:排序时候对NULL值的处理,
在Oracle官方文档中说明,null值在排序过程是个比较特殊的值类型,默认情况下排序时把它看成了最大值了,也就是说在排序的时候,,当排序的记录中出现了Null值,默认是,升序排列在最后,反过来在最前,那么也可以程序自己来定义它前后。
1、排在最前:
select xx from student order by xx nulls first;
2、排在最后
select xx from student order by xx nulls last;
然后就搞定了!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Reduce the use of MySQL memory in Docker

How do you alter a table in MySQL using the ALTER TABLE statement?

How to solve the problem of mysql cannot open shared library

What is SQLite? Comprehensive overview

Run MySQl in Linux (with/without podman container with phpmyadmin)

Running multiple MySQL versions on MacOS: A step-by-step guide

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?

How do I configure SSL/TLS encryption for MySQL connections?
