My simple way with left outer join


  • 1
    L
    SELECT C.Name
    FROM Customers  AS C LEFT OUTER JOIN Orders AS O
    ON C.Id = O.CustomerId
    WHERE O.CustomerId IS NULL;

Log in to reply
 

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