183. 从不订购的客户

# 498ms
select c.Name as Customers from Customers c left join Orders o on o.CustomerId = c.Id where o.Id is null;

# 532ms
select c.Name as Customers from Customers c where not exists (select 1 from Orders o where o.CustomerId = c.Id);

# 455ms
select c.Name as Customers from Customers c where c.Id not in (select distinct o.CustomerId from Orders o);

 

posted @   巴黎爱工作  阅读(107)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示