Sort latest most viewed questions according to tags?

0

Please login or register to vote for this query.

(click on this box to dismiss)

https://meta.stackexchange.com/questions/147055/sort-latest-most-viewed-questions-according-to-tags

Startups Meta

Q&A for entrepreneurs faced with delivering a new product or service under conditions of significant uncertainty

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

Enter Parameters

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