题解 | #获取当前薪水第二多的员工的emp_no以及其对应的薪水salary#
获取当前薪水第二多的员工的emp_no以及其对应的薪水salary
http://www.nowcoder.com/practice/8d2c290cc4e24403b98ca82ce45d04db
使用窗口函数denese_rank 能快捷做出来
select
a.emp_no,
a.salary
from
(select
emp_no,
salary,
dense_rank() over(order by salary desc) rank1
FROM
salaries)a
where rank1=2
order by a.emp_no