题解 | #获取每个部门中当前员工薪水最高的相关信息#
获取当前薪水第二多的员工的emp_no以及其对应的薪水salary
http://www.nowcoder.com/practice/8d2c290cc4e24403b98ca82ce45d04db
select t1.emp_no, t1.salary, t2.last_name, t2.first_name from ( select emp_no, salary, dense_rank() over (order by salary desc ) as rk from salaries )t1 left join ( select emp_no, last_name, first_name from employees )t2 on t1.emp_no = t2.emp_no where t1.rk =2;