Questions per month for a tag string family, compared

0

Please login or register to vote for this query.

(click on this box to dismiss)

Compares two tag strings and charts their activity over time. Fun comparison - sql-server versus oracle. If you put in sql-server, that line will also include similar tags like sql-server-2008 and sql-server-triggers. You can add as many tag parameters to this as you want by adding them to line 3's insert string.

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

Declare @TagList TABLE (TagNameLike nvarchar(25) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL)

INSERT INTO @TagList VALUES (##tag1:string##), (##tag2:string##)

select *, count(*) from
(
  select CAST(
      cast(DATEPART(YYYY, CreationDate) as varchar) + '-' + cast(DATEPART(MM, CreationDate) as varchar) + '-01'
    as datetime) [Month], 
    tl.TagNameLike
  from Posts p 
  INNER JOIN PostTags pt on pt.PostId = p.Id
  INNER JOIN Tags t on t.Id = pt.TagId
  INNER JOIN @TagList tl ON t.TagName LIKE '%' + tl.TagNameLike + '%' 
) as X
group by TagNameLike, [Month]
having count(*) > 25
order by [Month] asc, TagNameLike asc

Enter Parameters

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