SQL--》空值排序问题

思路一:将空值转换为最小值

select isnull(xsdd_dzid_pre,-1),* from xsdd_dzbh  order by 1 --oracle使用nvl

思路二:oracle的nulls first 和 nulls last

select xsdd_dzid_pre,* from xsdd_dzbh  order by 1 NULLS FIRST
posted @ 2021-12-20 08:30  红本本本  阅读(81)  评论(0)    收藏  举报