怎么通过SQL筛选出符合三个条件的唯一值,见说明!急求!

2024-12-27 04:02:28
推荐回答(1个)
回答1:

可以使用GROUP BY + HAVING
------------------------
SELECT Products_id
FROM TableX
WHERE products_attribute_key_id IN (12,18,30)
GROUP BY Products_id
HAVING COUNT(*) >= 3