BEST solutions || MySQL || Pandas || Beats 100% !!
Code\n\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\nSET N = N-1;\n  RETURN (\n      SELECT DISTINCT(salary) from Employee order by salary DES
# Code\n```\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\nSET N = N-1;\n  RETURN (\n      SELECT DISTINCT(salary) from Employee order by salary DESC\n      LIMIT 1 OFFSET N \n  );\nEND\n```\n```\nimport pandas as pd\n\ndef nth_highest_salary(employee: pd.DataFrame, N: int) -> pd.DataFrame:\n    unique_salaries = employee.salary.unique()\n    if len(unique_salaries) < N:\n        return pd.DataFrame([np.NaN], columns=[f\'getMthHighestSalary({N})\'])\n    else:\n        salary = sorted(unique_salaries, reverse=True)[N-1]\n        return pd.DataFrame([salary], columns=[f\'getMthHighestSalary({N})\'])\n```
['MySQL', 'Pandas']