[MySQL] Easy to understand. Beats 99% time
\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\n  SET N = N - 1;\n  RETURN (\n      select distinct(salary) from employee order by salary desc 
```\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\n  SET N = N - 1;\n  RETURN (\n      select distinct(salary) from employee order by salary desc LIMIT 1 OFFSET N\n  );\nEND\n```
[]