NTH HIGHEST SALARY


  • 0
    L
    CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
    BEGIN
    DECLARE M INT;
    SET M=N-1;
      RETURN (
          select
    (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.