nth highest salary
snippet in sql

nth highest salary

user6210

SELECT salary FROM Employee ORDER BY salary DESC LIMIT N-1, 1

find nth highest salary in sql

user7892

SELECT * FROM Employee WHERE sal = 
         (
            SELECT MIN(sal) FROM Employee 
            WHERE  sal IN (
                                 SELECT DISTINCT TOP N
                                     sal FROM Employee 
                                         ORDER BY sal DESC
                             )
        )

nth largest number sql query

user5514

SELECT * FROM Employee WHERE sal = 
         (
            SELECT MIN(sal) FROM Employee 
            WHERE  sal IN (
                                 SELECT DISTINCT TOP N
                                     sal FROM Employee 
                                         ORDER BY sal DESC
                             )
        )

3rd height salary sql

user5566

SELECT MIN(EmpSalary) from ( 
	SELECT EmpSalary from Employee ORDER BY EmpSalary DESC LIMIT 3 
);