Published on

Leetcode - 1045. Customers Who Bought All Products

Authors
  • avatar
    Name
    Indo Yoon
    Twitter
Table of Contents

문제

[Loading...

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

LeetCode

](https://leetcode.com/problems/customers-who-bought-all-products/description/)

정답

SELECT customer_id
FROM (SELECT DISTINCT customer_id, customer_id + '_' + product_key FROM Customer) as Temp
GROUP BY customer_id
HAVING COUNT(customer_id) = (SELECT COUNT(*) FROM Product)