Q&A for power users of web applications
--1 select p.Id, p.tags from posts p inner join ( select PostId from posttags where tagid in (4, 2) group by PostId having count(PostId) > 1 ) sep on p.Id = sep.PostId;