with peryear as ( select year(p.creationdate) as year_date,

0

Please login or register to vote for this query.

(click on this box to dismiss)

Skeptics

Q&A for scientific skepticism

with peryear as (
select year(p.creationdate) as year_date,
p.id,p.title,count(v.id) as upvote,
row_number() over (
partition by year(p.creationdate)
order by count(v.id) desc
) rn
from posts p
join votes v on v.postid = p.id
where v.votetypeid = 2
group by year(p.creationdate), p.id,p.title
)
select * from peryear
where rn <=10

Enter Parameters

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