可以使用GROUP BY + HAVING------------------------SELECT Products_idFROM TableXWHERE products_attribute_key_id IN (12,18,30)GROUP BY Products_idHAVING COUNT(*) >= 3