Users with most upvotes from anonymous feedback

1

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans

Q&A for music historians, critics, and fans

Select TOP(##num?100##)
  RANK() OVER(ORDER BY SUM(Case When pf.VoteTypeId = 2 Then 1 Else NULL End) DESC) AS Rank,
  p.OwnerUserId as [User Link], p.OwnerDisplayName,
  SUM(Case When pf.VoteTypeId = 2 Then 1 Else NULL End) AS UpFeedback,
  SUM(Case When pf.VoteTypeId = 3 Then 1 Else NULL End) AS DownFeedback,
  SUM(Case pf.VoteTypeId When 2 Then 1 WHEN 3 Then -1 End) AS Score,
  SUM(p.Score) AS [Total Score],
  SUM(Case When p.CommunityOwnedDate IS NULL Then p.Score ELSE 0 END) AS [nonCW Score]
FROM PostFeedback pf JOIN Posts p ON p.Id = pf.PostId
GROUP BY p.OwnerUserId, p.OwnerDisplayName
ORDER BY SUM(Case When pf.VoteTypeId = 2 Then 1 Else NULL End) DESC

Enter Parameters

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