Q&A for professional and amateur woodworkers
SELECT tag.TagName as Tag ,COUNT(1) as NumberOfPosts FROM Posts pst Inner Join PostTags ptag ON ptag.PostId = pst.Id Inner Join Tags tag ON tag.Id = ptag.TagId WHERE pst.Id IN ( SELECT ptag.PostId FROM PostTags ptag Inner Join Tags tag ON tag.Id = ptag.TagId WHERE UPPER(tag.TagName) in ('JAVA','CSS') ) and EXISTS ( SELECT 1 FROM Comments com WHERE com.PostId = pst.Id ) GROUP BY tag.TagName ;