标签: sql oracle oracle10g top-n
如何获得与员工相关的每个部门的2名员工的最高薪水?
答案 0 :(得分:2)
像这样的东西
select * from ( select employee_id,row_number() over (partition by department order by salary desc) as rno from employee ) t where rno<=2