薪资第一和第二都可能有多名,所以需要group by
SELECT emp_no,salary FROM salaries s
WHERE salary=
(
SELECT salary FROM salaries GROUP BY salary
ORDER BY salary DESC LIMIT 1,1
);
薪资第一和第二都可能有多名,所以需要group by
SELECT emp_no,salary FROM salaries s
WHERE salary=
(
SELECT salary FROM salaries GROUP BY salary
ORDER BY salary DESC LIMIT 1,1
);