568ms,Count+limit+DISTINCT


  • 0
    L
    SELECT e1.Salary
    FROM (SELECT DISTINCT Salary FROM Employee)e1
    WHERE (
      SELECT COUNT(Salary) FROM (SELECT DISTINCT Salary FROM Employee)e2 WHERE e1.Salary<e2.Salary
      )=N-1
    LIMIT 1
    

Log in to reply
 

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