薪水第二多的员工可能有多个,所以要重点确定第二多的薪水salary的值
利用子查询:获取salary值第二大的值🤣
-- 工资第二多的员工可能有多个 SELECT e.emp_no, s.salary, e.last_name, e.first_name FROM employees e INNER JOIN salaries s ON e.emp_no = s.emp_no WHERE s.to_date = '9999-01-01' AND s.salary = (SELECT MAX(salary) FROM salaries WHERE to_date = '9999-01-01' and salary < (SELECT MAX(salary) FROM salaries where to_date = '9999-01-01'))