My solutions --1305ms


  • 0
    L

    select
    a.Name
    from Employee a
    left join Employee b
    on a.ManagerId = b.Id
    where a.Salary > b.Salary
    ;


  • 1
    M
    enter code here
    

    select a.NAME from Employee as a , Employee as b where a.ManagerId = b.Id and a.Salary > b.Salary; (Accepted)

    select a.Name from Employee as a inner join Employee as b on a.ManagerId=b.Id where a.Salary>b.Salary; (Accepted)

    select a.Name from Employee as a left join Employee as b on a.ManagerId = b.Id where a.Salary > b.Salary ; (Accepted)
    left join outer is also OK.

    select a.Name from Employee as a right join Employee as b on a.ManagerId = b.Id where a.Salary > b.Salary ; (Accepted)
    right join outer is also OK

    below is wrong. natural join
    select a.Name from Employee as a natural join Employee as b on a.ManagerId = b.Id where a.Salary > b.Salary ; (wrong)


  • 0
    T

    I submit your solution and it take 1508ms


Log in to reply
 

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