DB2函数配合 select row_number() over(order by col desc nulls first/nulls last ) as rn,col from table1order by rn; nulls first:把空值放到最前面,再对非空值排序 nulls last:把空值放到最后面在对非空值排序