2D users reputation/scores

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

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 top 1000 sum(Upvote) as upvotes, OwnerUserId As [User Link], sum(DownVote) as downvotes from a
Group By OwnerUserId
Order By upvotes desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results