Problem: 1045. 买下所有产品的客户
Code
select customer_id
from customer
group by customer_id
having count(distinct product_key) -- 一个顾客购买的商品可能有很多个,所以必须去重
= (select count(product_key) from product)
Problem: 1045. 买下所有产品的客户
select customer_id
from customer
group by customer_id
having count(distinct product_key) -- 一个顾客购买的商品可能有很多个,所以必须去重
= (select count(product_key) from product)