MS SQL faster than 98.39% easy to understand
\nCREATE FUNCTION getNthHighestSalary(@N INT) RETURNS INT AS\nBEGIN\n    RETURN (\n        SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC OFFSET @N-1
```\nCREATE FUNCTION getNthHighestSalary(@N INT) RETURNS INT AS\nBEGIN\n    RETURN (\n        SELECT DISTINCT Salary FROM Employee ORDER BY Salary DESC OFFSET @N-1 ROWS FETCH NEXT 1 ROWS ONLY\n    );\nEND\n```
['MS SQL Server']