子查询找出第二多薪水,主查询选出所有薪水等于第二多薪水的员工并排序
select emp_no, salary from salaries where to_date='9999-01-01' and salary = (select salary from salaries where to_date='9999-01-01' order by salary DESC limit 1 OFFSET 1) order by emp_no;
子查询找出第二多薪水,主查询选出所有薪水等于第二多薪水的员工并排序
select emp_no, salary from salaries where to_date='9999-01-01' and salary = (select salary from salaries where to_date='9999-01-01' order by salary DESC limit 1 OFFSET 1) order by emp_no;