# 3rd highest salary in sql snippet in sql

## nth highest salary

user9742

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

## 3rd highest salary in sql

user1037

``````Here is the solution for 3rd highest
salary from employees table

SELECT FIRST_NAME , SALARY FROM
(SELECT FIRST_NAME, SALARY, DENSE_RANK() OVER
(ORDER BY SALARY DESC) AS SALARY_RANK
FROM EMPLOYEES)
WHERE SALARY_RANK = 3; ``````

## find nth highest salary in sql

user6208

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

## n highest salary in sql

user8631

``````SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP N salary
FROM #Employee
ORDER BY salary DESC
) AS temp
ORDER BY salary``````

## nth highest salary in sql

user9003

``````Here is the solution for nth highest
salary from employees table

SELECT FIRST_NAME , SALARY FROM
(SELECT FIRST_NAME, SALARY, DENSE_RANK() OVER
(ORDER BY SALARY DESC) AS SALARY_RANK
FROM EMPLOYEES)
WHERE SALARY_RANK = n; ``````

## nth largest number sql query

user7813

``````select * from(
select ename, sal, dense_rank()
over(order by sal desc)r from Employee)
where r=&n;

To find to the 2nd highest sal set n = 2
To find 3rd highest sal set n = 3 and so on.
``````