Something
public text v1 · immutableSELECT e . *
FROM entries e
INNER JOIN properties p1 ON p1.entry_id = e.id
AND p1.property = 'tag'
AND p1.value = 'sometag'
INNER JOIN properties p2
WHERE p2.entry_id = e.id
AND p2.property = 'person'
AND p2.value
IN (
SELECT p3.id
FROM people p3
INNER JOIN people_attributes a0 ON a0.person_id = p3.id
AND a0.key = 'age'
AND a0.value = '34'
)
INNER JOIN properties p4 ON p4.entry_id = e.id
AND p4.property = 'tag'
AND p4.value = 'anothertag'