Using Rank
Here is my solution using dense_rank\n\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\n  RETURN (\n      # Write your MySQL query statement belo
Here is my solution using dense_rank\n```\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\n  RETURN (\n      # Write your MySQL query statement below.\n      select distinct Salary\n      from \n      (select DENSE_RANK() over (order by Salary desc) as r, Salary\n        from Employee\n       ) as t\n      where r =N\n  );\nEND\n```
[]