题解 | #获取当前薪水第二多的员工的emp_no以及其对应的薪水salary#
获取当前薪水第二多的员工的emp_no以及其对应的薪水salary
http://www.nowcoder.com/practice/8d2c290cc4e24403b98ca82ce45d04db
薪资第一和第二都可能有多名,所以需要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
);
题解-SQL 文章被收录于专栏
SQL刷题