Super simple solution with MySQL, does not involve dense_rank()
\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\n  set N = N - 1;\n  RETURN (\n      Select Salary from Employee group by Salary order by Salary
```\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\n  set N = N - 1;\n  RETURN (\n      Select Salary from Employee group by Salary order by Salary DESC limit 1 offset N\n  );\nEND\n```
[]