在DB2中,Oracle的NULLS FIRST的等效性是什么?

pre*_*ott 2 sql db2

DB2是否有类似ORDER BY ord_col NULLS FIRST的东西?

And*_*mar 10

您可以使用caseorder by之前其他值排序空值:

select  *
from    YourTable
order by
        case when col1 is null then 0 else 1 end
,       col1
Run Code Online (Sandbox Code Playgroud)