SQL query to find Nth highest salary from a salary table

前端 未结 11 2228
隐瞒了意图╮
隐瞒了意图╮ 2020-11-28 10:45

How can I find the Nth highest salary in a table containing salaries in SQL Server?

11条回答
  •  [愿得一人]
    2020-11-28 11:08

    Very simple one query to find nth highest salary

    SELECT DISTINCT(Sal) FROM emp ORDER BY Salary DESC LIMIT n,1
    

提交回复
热议问题