Oracle 数据空值行位于查询结果的最前面或者最后面

1,排在最前面用order by name nulls first;

eg:select t.name,t.code from table t where t.code!='1' order by name nulls first;

2,排在最后面order by name nulls last;

eg:select t.name,t.code from table t where t.code!='1' order by name nulls last;
发布了89 篇原创文章 · 获赞 18 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/qq_32641813/article/details/103066103