Q&A for professional and enthusiast programmers
SELECT T.TagName, T.[Count] AS TagCount, COUNT(PT.PostId) AS PostTagCount FROM PostTags PT INNER JOIN Tags T ON T.Id = PT.TagId GROUP BY T.TagName, T.[Count] SELECT * FROM Tags WHERE TagName = 'qml' SELECT * FROM PostTags PT INNER JOIN Posts P ON P.Id = PT.PostId WHERE PT.TagId = 1180