In general, such a request
SELECT `product_id` FROM `oc_product_option_value` WHERE `option_value_id`='49' AND `option_value_id`='50' ORDER BY `product_id` ASC Trying to select id entries whose value is option_value_id = '50 'and option_value_id = '49' It is necessary to output id that have exactly 2 such matches, if only 1 entry matches, then id should not be included in the selection.

optional_value_idhave two values at once on a single line? And if you need to select two strings, in whichoptional_value_idis equal to either one value or another, thenANDmust be replaced byOR. - Sergey Gornostaev