Nth Highest Salary


  • 0
    S
    CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
    BEGIN
    DECLARE M int;
    SET M = N-1;
      RETURN (
          IFNULL((select distinct Salary from Employee order by Salary Desc limit M,1), null)    
      );
    END
    

Log in to reply
 

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