select p.id, count(v.id), t.name from posts p join votes ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physical Fitness

Q&A for physical fitness professionals, athletes, trainers, and those providing health-related needs

select p.id, count(v.id), t.name 
from posts p
join votes v on p.id = v.postid
join votetypes t on v.votetypeid = t.id and t.name in('UpMod', 'DownMod')
where 1 = 1
--and p.id <= 10000
group by p.id, t.name
order by count(v.id) desc;

Enter Parameters

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