Q&A about the site for members of the workforce navigating the professional setting
select t.views, avg(t.votes) from ( select max(p.viewcount) as views, sum(case when v.votetypeid in (2,3) then 1 else 0 end) as votes from posts p join votes v on v.postid = p.id where p.PostTypeId = 1 group by p.id ) as t group by t.views;