select top 100 p.id , sum(case when v.votetypeid = 2 then...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Drones and Model Aircraft Meta

Q&A for experienced flyers, pilots, and builders of drones and model aircraft

select top 100 p.id
, sum(case when v.votetypeid = 2 then 1.0 / datediff(day,getdate(), v.creationdate) else null end) 
from posts p 
inner join votes v on v.postid = p.id
where v.votetypeid = 2 
group by p.id
order by 2 desc

Enter Parameters

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