Accepted(281ms) solution just add one variable term n=n-1
\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\nset n=n-1;\n  RETURN (\n      # Write your MySQL query statement below.\n      # select   avg(s
```\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\nset n=n-1;\n  RETURN (\n      # Write your MySQL query statement below.\n      # select   avg(salary) from employee try and error method \n        select distinct salary from employee order by salary desc\n        limit 1 offset n\n  );\nEND\n```
['MySQL']