MS Sql Server
\nCREATE FUNCTION getNthHighestSalary(@N INT) RETURNS INT AS\nBEGIN\n    RETURN (\n        SELECT DISTINCT Salary\n        FROM Employee\n        ORDER BY Salar
```\nCREATE FUNCTION getNthHighestSalary(@N INT) RETURNS INT AS\nBEGIN\n    RETURN (\n        SELECT DISTINCT Salary\n        FROM Employee\n        ORDER BY Salary DESC\n        OFFSET @N-1 ROWS\n        FETCH NEXT 1 ROWS ONLY\n    );\nEND\n```
[]