[leetcode-cn] 1045-customers-who-bought-all-products

https://leetcode.cn/problems/customers-who-bought-all-products/

Copy
SELECT c.customer_id
FROM Customer c
INNER JOIN Product p
ON c.product_key = p.product_key
GROUP BY c.customer_id
HAVING COUNT(DISTINCT(c.product_key)) = (SELECT COUNT(product_key) FROM Product)