https://leetcode.com/problems/nth-highest-salary


Runtime: 317 ms, faster than 64.56% of MySQL online submissions for Nth Highest Salary.

Memory Usage: 0B, less than 100.00% of MySQL online submissions for Nth Highest Salary.


```mysql
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
    #9:45
    DECLARE returnValue INT;
    DECLARE N2 INT;
    SET N2 = N - 1;
    
    SELECT DISTINCT salary FROM Employee
    ORDER BY salary DESC
    LIMIT N2,1 #Here the 1 is the limit, for example, only return 1 row
    INTO returnValue;
    
    RETURN returnValue;
    #9:59
    #debug until 10:09
END
```
