Home > Database > Mysql Tutorial > body text

Oracle 数字与空值的排序问题

WBOY
Release: 2016-06-07 17:01:39
Original
996 people have browsed it

今天在做项目的时候遇到一个数据排序的问题,当排序字段为空时,空值会排在数字的前面,这样的排序会非常难看,经过一番努力,终

今天在做项目的时候遇到一个数据排序的问题,,当排序字段为空时,空值会排在数字的前面,这样的排序会非常难看,经过一番努力,终于找到原因了。因为Oracle认为空值是最大的值,所以将SQL语句改为 ...order by ”排序字段"  desc nulls last。

问题很容易就解决了。

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template