方法一:

思路:

先子查询出第二高的薪水,在查询出 salary = 第二高薪水的(emp_no ,salary)

代码:

select
    emp_no,
    salary
from
    salaries
where
    salary = (
        select
            salary
        from
            salaries
        group by
            salary
        order by
            salary desc
        limit
            1, 1
    )