WA, what's wrong?


  • 0
    K

    why does this code wrong? what happened to my code?

        CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
    BEGIN
      RETURN (
          # Write your MySQL query statement below.
          select Id from  (select @num:=@num+1 as rank, a.Id as Id from Employee as a, (select @num:=0) as b order by Salary desc)sub where N = sub.rank
      );
    END

Log in to reply
 

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