Tag count by COUNT(Posts.Id)

0

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, SUM(Q.ID) AS PostTagCount
FROM Posts Q
  INNER JOIN PostTags PT ON PT.PostId = Q.Id
  INNER JOIN Tags T ON T.Id = PT.TagId
GROUP BY T.TagName, T.[Count]

Enter Parameters

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