Q&A about the site for Ubuntu users and developers
select (case when p.posttypeid = 1 then 'Question' when p.posttypeid = 2 then 'Answer' end) as Type, count(*) As Votes from votes v join posts p on v.postid = p.id where v.votetypeid in (2,3) and v.userid = 111554 group by p.posttypeid