Simple and Time efficient(Run Time : 675 ms) solution


  • 0
    D
    select Name as Customers 
    From Customers 
    Where Id not in (select distinct(CustomerId) from Orders);
    

    distinct will remove duplicate CustomerId from Orders table.


Log in to reply
 

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