Answer the question
In order to leave comments, you need to log in
How to select the id of a record from a table where two keys match?
SELECT entity_id FROM products WHERE value_id = '19' and value_id = '12'
SELECT entity_id FROM products WHERE value_id = '19' and (value_id = '2' OR value_id = '12')
Answer the question
In order to leave comments, you need to log in
SELECT `p1`.`entity_id`
FROM `products` AS `p1`
JOIN `products` AS `p2` USING(`entity_id`)
WHERE `p1`.`value_id` = '19'
AND `p2`.`value_id` = '12'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question