Ask for help with SQL select query


  • 0
    F

    here is my code

    select Salary as SecondHighestSalary from Employee as e1 where (e1.Id <> ANY (select Id from Employee as e where e.Salary >= ANY (select Salary from Employee)) and e1.Salary >= ANY (select Salary from Employee as e2 where e2.Id <> ANY (select Id from Employee as e where e.Salary >= ANY (select Salary from Employee))));
    

    I think it logically makes sense but it could not pass the test, why?


Log in to reply
 

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