【DB2】NULLS LAST与NULLS FIRST

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

posted @ 2018-06-21 09:04  OLIVER_QIN  阅读(938)  评论(0编辑  收藏  举报