原题在这里插入图片描述
思路
not in
代码
select distinct buyer_id
from Sales s join Product p on s.product_id=p.product_id
where p.product_name='S8'
and buyer_id not in (select buyer_idfrom Sales s join Product p on s.product_id=p.product_idwhere p.product_name='iPhone')