题目:

题解:
1、使用左连接
解题思路:
sql语句:
1
2
3
4
5select a.Name as Customers
from Customers as a
left join Orders as b
on a.Id = b.CustomerId
where b.CustomerId is null;
2、使用子查询和 NOT IN 子句
sql语句:
1
2
3
4
5
6select a.Name as Customers
from Customers as a
where a.id not in
(
select CustomerId from Orders
);
