Self join using INNER JOIN, STRAIGHT_JOIN or JOIN


  • 0
    O

    1252 ms

    SELECT Emps.Name from Employee Emps
    INNER JOIN Employee Mans
    ON Mans.Id = Emps.ManagerId
    where Emps.Salary > Mans.Salary;
    

    1257 ms

    SELECT Emps.Name from Employee Emps
    STRAIGHT_JOIN Employee Mans
    ON Mans.Id = Emps.ManagerId
    where Emps.Salary > Mans.Salary;
    

    1304 ms

    SELECT Emps.Name from Employee Emps
    JOIN Employee Mans
    ON Mans.Id = Emps.ManagerId
    where Emps.Salary > Mans.Salary;

Log in to reply
 

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