Tag statistics

0

Please login or register to vote for this query.

(click on this box to dismiss)

Views, Score and Answers per Game (with limited blacklist for other tags)

Reverse Engineering Meta

Q&A about the site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation

-- Tag statistics
-- Views, Score and Answers per Tag

DECLARE @total float
SELECT @total = Sum(Cast(ViewCount as bigint)) FROM Posts WHERE PostTypeId = 1

SELECT TOP(10)
    Tags.Tagname AS Tag, 
    Count(*) AS Questions, 
    Sum(Cast(Posts.ViewCount as bigint)) AS Views,
    Sum(Posts.AnswerCount) AS Answers
  FROM Posts 
  JOIN PostTags ON Posts.Id = PostTags.PostId
  JOIN Tags ON PostTags.TagId = Tags.Id
  WHERE Posts.PostTypeId = 1 AND YEAR(Posts.CreationDate) <= 2017
  GROUP BY Tags.Tagname
  ORDER BY Views DESC

Enter Parameters

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