Questions views over the years

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

select year(creationdate) as [year], month(creationdate) AS [month], 
       sum(viewcount) / count(p.id) as [average views] 
from posts p
join posttypes pt on p.posttypeid = pt.id
where year(creationdate) >= 2011
and pt.name = 'Question'
group by year(creationdate), month(creationdate)
order by year(creationdate), month(creationdate)

Enter Parameters

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