选择第二个最高薪水 [英] To select second maximum salary
本文介绍了选择第二个最高薪水的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Find the 2nd maximum salary for every department.
SELECT TOP(1) SALARY
FROM EMPLOYEES
WHERE SALARY IN( SELECT DISTINCT TOP(2) SALARY FROM EMPLOYEES
-- GROUP BY SALARY,DNO
ORDER BY SALARY desc
)
GROUP BY DNO,SALARY
我无法获得正确答案
I am unable to get the correct answer
推荐答案
这个问题大学里的每一次新摄入都会被问到,并且已经在这里多次回答...从这个答案选择 [ ^ ]
This question gets asked with every new intake at college and has been answered here many many times ... pick your favourite from this selection of answers[^] on CodeProject
这篇关于选择第二个最高薪水的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文