2. Top 10 posts and comments past 5 years

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mythology Meta

Q&A about the site for enthusiasts and scholars of mythology and folklore

select top 10 owneruserid as id, count(*) as post_comm_count
from posts
join comments on owneruserid = userid
where posts.creationdate >= datefromparts(year(getdate()) - 5,1,1)
and comments.creationdate >= datefromparts(year(getdate()) - 5,1,1)
group by owneruserid order by post_comm_count desc;

Enter Parameters

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