oracle 支持 select * from table1 order by col desc
nulls last/nulls first
将“col” 这一列降序并且将空的值放到最后/最前
db2 则不支持直接使用
需要用函数配合
select
row_number() over(order by col desc
nulls first/nulls last ) as rn,col from table1order by rn;
但是不知道为什么使用select
*,
row_number() over(order by col desc
nulls first/nulls last ) as rn from table1order by rn;
就会报错。