Questions per month for 2 tags of your choice, compared

0

Please login or register to vote for this query.

(click on this box to dismiss)

Forked from query #59734 by sam.saffron. How many questions per month does each tag of your choice get? Now defaults to two tags, but it's easy to add more (up to 10k?). See http://stackoverflow.com/questions/1869753/maximum-size-for-a-sql-server-query-in-clause-is-there-a-better-approach

Artificial Intelligence

Q&A for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment

Declare @Tag1 varchar(20)
Declare @Tag2 varchar(20)


set @Tag1 = isnull(ltrim(##tag1:string##), 'javascript')
set @Tag2 = isnull(ltrim(##tag2:string##), 'java')


select *, count(*) from
(
  select CAST(
      cast(DATEPART(YYYY, CreationDate) as varchar) + '-' + cast(DATEPART(MM, CreationDate) as varchar) + '-01'
    as datetime) [Month], 
    t.TagName
  from Posts p 
  join PostTags pt on pt.PostId = p.Id
  join Tags t on t.Id = pt.TagId
  where TagName in 
  (
  @Tag1, 
  @Tag2
  )
) as X
group by TagName, [Month]
order by [Month] asc, TagName asc

Enter Parameters

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