Say there is such table:
mysql> SELECT * FROM tags; +---------+--------+ | post_id | tag_id | +---------+--------+ | 1 | 2 | | 1 | 3
WHERE version of @Keeper's solution
SELECT DISTINCT t1.post_id FROM tags t1, tags t2 WHERE t1.post_id = t2.post_id AND t1.tag_id = 1 AND t2.tag_id = 3