【Oracle】【16】字段值为null的排序问题

正文:

Oracle默认null是最大值

--null值始终排前面
select * from table order by id asc nulls first
--null值始终排后面
select * from table order by id desc nulls last

参考博客:

ORACLE中null的排序问题 - heartdiamond的专栏 - CSDN博客
https://blog.csdn.net/heartdiamond/article/details/6057562

猜你喜欢

转载自www.cnblogs.com/huashengweilong/p/10924951.html