문제
입력 코드
SELECT customer_id
FROM Customer
GROUP BY customer_id
HAVING COUNT(DISTINCT(product_key)) = (SELECT COUNT(product_key) FROM Product);
코드 설명
#SELECT #GROUP BY #HAVING #COUNT #DISTINCT
문제 출처
'SQL' 카테고리의 다른 글
#105. [LeetCode / MySQL] 1789. Primary Department for Each Employee (0) | 2023.10.01 |
---|---|
#104. [LeetCode / MySQL] 1731. The Number of Employees Which Report to Each Employee (0) | 2023.09.30 |
#101. [LeetCode / MySQL] 1729. Find Followers Count (0) | 2023.09.27 |
#100. [LeetCode / MySQL] 596. Classes More Than 5 Students (0) | 2023.09.26 |
#99. [LeetCode / MySQL] 1070. Product Sales Analysis III (0) | 2023.09.25 |