Oracle查询语句
select * from scott.emp ;
1.–dense_rank()分析函数(查找每个部门工资最高前三名员工信息)
select * from (select deptno,ename,sal,dense_rank() over(partition by deptno order by sal desc) a from scott.emp) where a<=3 order by deptno asc,sal desc ;
结果:
–rank()分析
Oracle查询语句
select * from scott.emp ;
1.–dense_rank()分析函数(查找每个部门工资最高前三名员工信息)
select * from (select deptno,ename,sal,dense_rank() over(partition by deptno order by sal desc) a from scott.emp) where a<=3 order by deptno asc,sal desc ;
结果:
–rank()分析