red.snapper

red.snapper

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

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

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)
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.