Back
Can you please tell me how to find nth highest salary in SQL?
The following is the query to find the nth highest salary from a table in SQL. This is the most commonly asked question in the interviews and you can read this SQL interview questions blog for more such FAQs in the SQL interview.
select e1.EmployeeName from Employee as e1where n = (select count (*) from Employee e2 where e2.salary >= e1.salary)
select e1.EmployeeName from Employee as e1
where n = (select count (*)
from Employee e2
where e2.salary >= e1.salary)
31k questions
32.8k answers
501 comments
693 users