Q&A for system and network administrators
SELECT COUNT(v.id) as votes, COUNT(p.id) as posts, CAST( CAST(COUNT(v.id) as DECIMAL(20,5)) / CAST(COUNT(p.id) as DECIMAL(20,5)) as DECIMAL(20,5)) as voteweight FROM votes v left join posts p on p.id = v.postid where v.VoteTypeId in ('2', '3')