Accepted solution using correlated subquery


  • 1
    Z
    select distinct(Salary) from Employee e1 where (N - 1) = (select count(distinct(e2.Salary)) from Employee e2 where e2.Salary > e1.Salary)

Log in to reply
 

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