题解 | #获取当前薪水第二多的员工的emp_no以及其对应的薪水salary#
获取当前薪水第二多的员工的emp_no以及其对应的薪水salary
http://www.nowcoder.com/practice/c1472daba75d4635b7f8540b837cc719
去掉最高的再查最高的就是第二高的
SELECT e2.emp_no, s2.salary, e2.last_name, e2.first_name FROM employees e2 INNER JOIN salaries s2 ON e2.emp_no = s2.emp_no WHERE s2.salary = ( SELECT max(s.salary) FROM employees e INNER JOIN salaries s ON e.emp_no = s.emp_no WHERE s.salary < ( SELECT MAX(salary) FROM salaries ) )