Nth Highest Salary Using LIMIT and IFNULL
\nCREATE FUNCTION getNthHighestSalary(n INT) RETURNS INT\nBEGIN\n\n  DECLARE _offset int ;\n  SET _offset = n-1;\n  \n  RETURN (\n      \n        select ifnull(
```\nCREATE FUNCTION getNthHighestSalary(n INT) RETURNS INT\nBEGIN\n\n  DECLARE _offset int ;\n  SET _offset = n-1;\n  \n  RETURN (\n      \n        select ifnull( \n            \n            (select distinct(salary) from Employee order by salary desc limit 1 offset _offset )\n            , null)  \n      \n  );\nEND\n```
['MySQL']