Вы можете использовать where
, group by
и having
:
select product_id
from t
where (field_id = 1 and value = 100) or (field_id = 2 and value = 200 )
group by product_id
having count(*) = 2;
Если допускаются дубликаты, тогда вы хотите count(distinct field_id) = 2
.