My accepted easy to understand solution


  • 0
    C
    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.