Q&A for professionals and students of engineering
SELECT votetype.name as type, count(*) as count FROM votetypes as votetype LEFT join votes as vote on vote.votetypeid = votetype.id LEFT join posts as post on vote.postid = post.id WHERE post.owneruserid = ##userid## OR post.owneruserid IS NULL GROUP BY votetype.name