1、題目描述
來源:力扣(LeetCode)
2、解題思路
1# 首先對Customer
去重,select distinct * from customer
2# 然後,統計每個客人購買的貨物種類數量select customer_id,count(product_key) cou1
3# 增加子表,對Product
統計所有貨物種類select count(*) as cou2 from Product
4# 對比兩個量
3、提交記錄
select customer_id
from
(select customer_id,count(product_key) cou1
from (select distinct * from customer)a3
group by customer_id) a,
(select count(*) as cou2
from Product)b
where a.cou1=b.cou2