Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select top 100 tagname
- , sum(cast(p.viewcount as bigint)) as [sum of views]
- , avg(cast(p.viewcount as bigint)) as [average of views]
- from posts p
- inner join posttags pt on pt.postid = p.id
- inner join tags t on t.id = pt.tagid
- where p.creationdate > dateadd(m, -1, getdate())
- and p.posttypeid = 1
- group by tagname
- order by 2 desc
Add Comment
Please, Sign In to add comment