Q&A for scholars and enthusiasts of literature
select v.postid, count(v.id) as nbr_votes, vt.name from votes v left join VoteTypes vt on v.id=vt.id group by v.PostId, vt.name order by 2 desc