Percentage of questions in given tags per month


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

;with pcnt as
select eomonth(p.creationdate) [date]
     , count( as [count]
from posts p
where p.PostTypeId=1
group by eomonth(p.creationdate)
, tagsel as 
select distinct creationdate,
from posts p
inner join posttags pt on pt.postid =
inner join tags t on = pt.tagid
inner join string_split(##tags:string?phsics,c++##,',')
         on value = t.tagname
where p.creationdate between ##date1:string?2008-01-01##
                         and ##date2:string?2019-01-01##
, tagstats as
  select eomonth(creationdate) [date]
       , count(id) [tagcount]
  from tagsel
  group by eomonth(creationdate)  

select pcnt.[date]
     , convert(decimal, tagcount) * 100 / [count] [perc]
from tagstats
inner join pcnt on pcnt.[date] = tagstats.[date]
order by pcnt.[date]

Enter Parameters

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