题意:找出customer从没有在order表中出现过的顾客的名字
解法:用内部链接选出所有在order表中出现过的顾客的名字,并作为新表,然后取出customer中没在该表中出现过的名字
select Customers.name from Customers where id not in(select Customers.id from Customers inner join Orders on Customers.id = Orders.CustomerId)
题意:找出customer从没有在order表中出现过的顾客的名字
解法:用内部链接选出所有在order表中出现过的顾客的名字,并作为新表,然后取出customer中没在该表中出现过的名字
select Customers.name from Customers where id not in(select Customers.id from Customers inner join Orders on Customers.id = Orders.CustomerId)