I have two SQL Tables, \'products\' and \'tags\'. They have an n:m relationship, using a third table \'product_tags\'.
I want to use a query to find every product that h
You can use this solution. This gets all products that contain ALL keywords 1, 23, and 54:
SELECT a.*
FROM products a
INNER JOIN product_tags b ON a.product_id = b.product_id
WHERE b.tag_id IN (1,23,54)
GROUP BY a.product_id
HAVING COUNT(1) = 3
Where 3
is the number of items in your WHERE IN
list, so you can adjust accordingly based on the amount of tags you want to check on.