I’m wanting to modify the following query so that it requires both tags exist on the current element. It’s essentially requiring that 2 rows exist in tags_to_content with the specific ID…
SELECT
content.id,
content_text.content
FROM content
INNER JOIN tags_to_content ON (
tags_to_content2.tag_id IN (1, 2) AND
tags_to_content2.content_id = content.id
)
The usual way to solve this is to join for each of the desired tags: