with toptags as (select top 5 pt.tagid from posts p inner...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Webmasters

Q&A for pro webmasters

with toptags as (select top 5 pt.tagid
						 from posts p
							  inner join posttags pt on p.id = pt.postid
						where p.creationdate >= '2021-01-01'
						group by pt.tagid
						order by count(pt.postid) desc
		   )
	select cast(p.creationdate as date) as creationdate,
		   t.tagname,
		   sum(count(p.id)) over (partition by t.tagname order by cast(p.creationdate as date)) as cumulative
	  from posts p
		   inner join posttags pt on p.id = pt.postid
		   inner join toptags tt on pt.tagid = tt.tagid
		   inner join tags t on tt.tagid = t.id
	 where p.creationdate >= '2021-01-01'
	 group by cast(p.creationdate as date), t.tagname
	 order by cast(p.creationdate as date), t.tagname;

Enter Parameters

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