Answers for "find the nth maximum salary in a employee table"

SQL
1

find nth highest salary of an employee

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

#Method 2
SELECT salary FROM Employee AS e1 
WHERE n-1=(SELECT COUNT(DISTINCT,salary) FROM Employee AS e2 
           WHERE e2.salary>e1.salary)
Posted by: Guest on September-08-2021

Code answers related to "find the nth maximum salary in a employee table"

Code answers related to "SQL"

Browse Popular Code Answers by Language