177. Nth Highest Salary


  • 0
    L

    CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
    BEGIN
    DECLARE X INT;
    SET X=N-1;
    RETURN (
    # Write your MySQL query statement below.
    SELECT DISTINCT Salary FROM Employee ORDER by Salary DESC LIMIT X, 1
    );
    END


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.