Using LIMIT and OFFSET
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\nSET N = N-1;\n  RETURN (\n      SELECT DISTINCT(salary) \n      FROM Employee\n      ORDER BY sal
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\nSET N = N-1;\n  RETURN (\n      SELECT DISTINCT(salary) \n      FROM Employee\n      ORDER BY salary DESC\n      LIMIT 1 OFFSET N\n  );\nEND
['MySQL']