2D users reputation/scores

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

WITH a AS (
   SELECT 
       OwnerUserId,
       CASE
          WHEN VoteTypeId = 2
             THEN 1
             ELSE 0
       END Upvote,
       CASE
          WHEN VoteTypeId = 3
             THEN 1
             ELSE 0
       END DownVote
   FROM Posts p INNER JOIN Votes v ON v.PostId = p.Id
)


Select OwnerUserId, sum(Upvote), sum(DownVote) from a
Group By OwnerUserId

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results