score:1

Accepted answer

Hmmm . . . does this work?

select pa.product_id
from product_attribute pa left join
     search_filter f
     on pa.attr_name = f.name
group by pa.product_id
having sum(case when pa.value = f.value then 1 else 0 end) = count(distinct f.name);

More questions

More questions with similar tag