Loading

SQL17 获取当前薪水第二多的员工的emp_no以及其对应的薪水salary

https://www.nowcoder.com/practice/8d2c290cc4e24403b98ca82ce45d04db?tpId=82&tags=&title=&difficulty=0&judgeStatus=0&rp=1

SELECT s.emp_no,s.salary
FROM salaries s
WHERE s.salary = (
    SELECT DISTINCT salary from salaries 
    order by salary DESC
    LIMIT 1,1
)
ORDER BY s.emp_no;

(这是第一次自己的做出的题目,加油)

posted @ 2022-01-09 10:57  Zhbeii  阅读(44)  评论(0)    收藏  举报