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(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

Enter Parameters

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