ORACLE dense_rank + exception
\nCREATE FUNCTION getNthHighestSalary(N IN NUMBER) RETURN NUMBER IS\nresult NUMBER;\nBEGIN\n    /* Write your PL/SQL query statement below */\n   \n    select d
```\nCREATE FUNCTION getNthHighestSalary(N IN NUMBER) RETURN NUMBER IS\nresult NUMBER;\nBEGIN\n    /* Write your PL/SQL query statement below */\n   \n    select distinct salary\n      into result\n      from (select salary\n                 , dense_rank() over (order by salary desc) rn\n              from Employee)\n     where rn = n; \n     \n        return result;\nexception \n    when no_data_found then\n        return null;\n    \nEND;\n```
['Oracle']