Users with highest score from anonymous feedback

1

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

Select TOP(##num?100##)
  RANK() OVER(ORDER BY SUM(Case pf.VoteTypeId When 2 Then 1 WHEN 3 Then -1 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 pf.VoteTypeId When 2 Then 1 WHEN 3 Then -1 End) DESC

Enter Parameters

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