Compare tag usage over time

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 *  
  FROM 
  (
  SELECT p.id, t.TagName, year(p.CreationDate) as [year]
  FROM Tags t
  JOIN PostTags pt on pt.TagId = t.id
  JOIN Posts p on pt.PostId = p.id
  
  -- where t.TagName in ( ##tags## )

  ) a 
  PIVOT (
  -- count(id) FOR TagName IN ([spring-mvc], [playframework])
  count(id) FOR TagName IN ( ##tags## )
  ) p 
order by year

-- tags format: [spring-mvc], [java]

Enter Parameters

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