Questions per month for a tag string family, compared


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for participants in team and individual sport activities

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

INSERT INTO @TagList VALUES (##tag1:string?valuesql-server##), (##tag2:string##)

select *, count(*) from
  select CAST(
      cast(DATEPART(YYYY, CreationDate) as varchar) + '-' + cast(DATEPART(MM, CreationDate) as varchar) + '-01'
    as datetime) [Month], 
  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

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