MySql with Dense Rank
\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\n  RETURN (\n    select salary from (\n        select distinct salary, \n              DENSE_RAN
```\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\n  RETURN (\n    select salary from (\n        select distinct salary, \n              DENSE_RANK() over (order by salary desc) as row_num\n        from Employee) temp\n    where row_num=N\n  );\nEND```
[]