Horje
find nth highest salary of an employee Code Example
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)
nth highest salary
SELECT salary FROM Employee ORDER BY salary DESC LIMIT N-1, 1




Sql

Related
athena drop partition Code Example athena drop partition Code Example
mysql add column default value Code Example mysql add column default value Code Example
mysql add column tinyint default 0 Code Example mysql add column tinyint default 0 Code Example
add sequence postgres Code Example add sequence postgres Code Example
create new index takes long time postgresql Code Example create new index takes long time postgresql Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9