Skip to content

1083. Sales Analysis II 👍

1
2
3
4
5
6
7
8
SELECT Sales.buyer_id
FROM Sales
INNER JOIN Product
  USING (product_id)
GROUP BY 1
HAVING
  SUM(Product.product_name = 'S8') > 0
  AND SUM(Product.product_name = 'iPhone') = 0;