Answer tag stats per year

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

DECLARE @UserId int = ##UserId##;

SELECT 
  Tags.TagName,
  YEAR(Answers.CreationDate) AS Year,
  COUNT(*) as Total
FROM 
  Posts AS Answers
  INNER JOIN Posts Questions ON (Answers.ParentId = Questions.Id)
  INNER JOIN PostTags ON (Questions.Id = PostTags.PostId)
  INNER JOIN Tags ON (PostTags.TagId = Tags.Id)
WHERE 
  Answers.OwnerUserId = @UserId AND 
  Answers.PostTypeId = 2
GROUP BY
  Tags.TagName,
  YEAR(Answers.CreationDate)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results