I\'m quite a begginer and I have two tables: \"product\" and \"product attributes\".
Here\'s some imaginary data (the actual stuff involves more tables )
Pr
select P.id, P.name, count(P.id) as matched_attr_count, count(PA.a_id) as total_attr_count from product_attributes PA left join product P on P.id = PA.p_id and PA.a_id in (21,23,24) group by PA.p_id having matched_attr_count = total_attr_count;