Say there is such table:
mysql> SELECT * FROM tags; +---------+--------+ | post_id | tag_id | +---------+--------+ | 1 | 2 | | 1 | 3
You could try a self join (N tag_id -> N join) but probably it's not fast
SELECT t1.post_id FROM tags t1 INNER JOIN tags t2 ON t1.post_id = t2.post_id WHERE t1.tag_id = 1 AND t2.tag_id = 3