Nth highest Salary


  • 0
    F

    '''
    CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
    BEGIN
    DECLARE M INT;
    SET M=N-1;
    RETURN (
    # Write your MySQL query statement below.
    select (
    select distinct Salary
    from Employee
    order by Salary desc
    limit M, 1) as getNthHighestSalary
    );
    END
    '''


Log in to reply
 

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