Answers for "nth highest salary"

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
0

3rd height salary sql

SELECT MIN(EmpSalary) from ( 
	SELECT EmpSalary from Employee ORDER BY EmpSalary DESC LIMIT 3 
);
Posted by: Guest on October-20-2020
0

nth highest salary

SELECT salary FROM Employee ORDER BY salary DESC LIMIT N-1, 1
Posted by: Guest on February-07-2020

Code answers related to "nth highest salary"

Code answers related to "SQL"

Browse Popular Code Answers by Language