Nth Highest Salary


  • 0
    T

    CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
    BEGIN
    DECLARE M INT;
    SET M=N-1;
    RETURN (
    # Write your MySQL query statement below.
    select distinct salary
    from Employee ORDER BY salary DESC
    Limit 1 offset M

    );
    END


Log in to reply
 

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