WA, what's wrong?

  • 0

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

        CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
      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

Log in to reply

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