oracl 和db2 常用语法比较: 1、取前N条记录 Oracle:Select * from TableName where rownum <= N; DB2:Select * from TableName fetch first N rows only; 2、取得系统日期 Oracle:Select sysdate from dual; DB2:Select current timestamp from sysibm.sysdummy1; 3、空值转换 Oracle:Select
原始数据展示
一:SQL展示
select id,name,age,salary,row_number()over(order by salary desc) rnfrom TEST_ROW_NUMBER_OVER tSQL语句后的展示:
SQL解释:根据salary倒叙,进行排序,但是没有进行分组
二、SQL展示
select id,name,age,salary,row_number()over(partition by id order b