- Published on
Leetcode - 1083. Sales Analysis II
- Authors
- Name
- Indo Yoon
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/sales-analysis-ii/description/)
정답
SELECT DISTINCT buyer_id FROM Sales
JOIN Product ON Sales.product_id = Product.product_id
WHERE Product.product_name = 'S8'
AND buyer_id NOT IN (
SELECT buyer_id FROM Sales
JOIN Product ON Sales.product_id = Product.product_id
WHERE Product.product_name = 'iPhone'
)