My Solution with 820 ms.


  • 2
    M
     SELECT IF(COUNT(*) = 0, NULL, MAX(Salary)) AS Salary
     FROM Employee AS E
     WHERE E.Salary != (SELECT MAX(E2.Salary) FROM Employee AS E2)

Log in to reply
 

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