183. Customers Who Never Order

问题描述

解决方案

嵌套子查询 730 ms

select Name as Customers from Customers 
where Id 
not in 
(
select CustomerId from Orders
);

关联查询 660 ms

select Name  as Customers from Customers 
left join Orders on Customers.Id=Orders.CustomerId 
where  CustomerId  is NULL
posted @ 2016-08-08 10:50  弦断  阅读(138)  评论(0编辑  收藏  举报