Q&A about the site for linguists, teachers and students of the Ukrainian language
select u.Id as [User Link], sum (case when PostTypeId = 1 and VoteTypeId = 2 then 1 else 0 end) as QuestionUpVotes, sum (case when PostTypeId = 2 and VoteTypeId = 2 then 1 else 0 end) as AnswerUpVotes from Votes v join Posts p on v.PostId = p.Id join Users u on v.UserId = u.Id group by u.Id order by QuestionUpvotes desc