Tag count by COUNT(Posts.Id)


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT T.TagName, T.[Count] AS TagCount, COUNT(P.Id) AS PostTagCount
FROM Posts P
  INNER JOIN PostTags PT ON PT.PostId = P.Id
  INNER JOIN Tags T ON T.Id = PT.TagId
GROUP BY T.TagName, T.[Count]

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results