1./*小于最大的最大的就是第二大的
select emp_no ,max(salary) from salaries
where to_date='9999-01-01'
and salary <> (
select max(salary) from salaries
)
2.逆序排列从第二个取(无法取出同样是第二大的)
select emp_no , salary
from salaries
where to_date='9999-01-01'
order by salary desc
limit 1,1
3.可以取出相同第二大的
select emp_no , salary
from salaries
where to_date='9999-01-01'
and salary = (select salary from salaries
group by salary
order by salary desc
limit 1,1);