2 MySQL Sols: DENSE_RANK() & LIMIT+OFFSET
1. Using DENSE_RANK() OVER\n\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\n  RETURN (\n      # Write your MySQL query statement below.\n      
### 1. Using `DENSE_RANK() OVER`\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 \n                salary,\n                DENSE_RANK() OVER (ORDER BY salary DESC) AS \'index_no\'\n            FROM Employee) e\n      WHERE index_no = N\n  );\nEND\n```\n\n### 2. Using `LIMIT` & `OFFSET`\n```\nCREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT\nBEGIN\nDECLARE M INT;\nSET M=N-1;\n  RETURN (\n      # Write your MySQL query statement below.\n      SELECT DISTINCT(salary)\n      FROM Employee\n      ORDER BY salary DESC\n      LIMIT 1 OFFSET M  \n  );\nEND\n```\n\n\n##### Further Readings:\n* [RANK() vs DENSE_RANK() vs ROW_NUMBER() - StackOverFlow](https://stackoverflow.com/a/22081083)\n\nThanks for reading!\nIf there\'s any error or doubt, do comment. Feedbacks are always appreciated!!
['MySQL']