Nth Highest Salary offset


  • 0
    A

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


Log in to reply
 

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