Controversial suggested edit reviews

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT v.UserId AS [User Link],
  'site://suggested-edits/' + CAST(v.SuggestedEditId AS NVARCHAR) AS 'Suggested edit',
  v.CreationDate AS 'Date',
  CASE v.VoteTypeId WHEN 2 THEN 'Approve' ELSE 'Reject' END AS 'Vote'
FROM SuggestedEditVotes AS v INNER JOIN 

(
SELECT v.SuggestedEditId, ROUND(AVG(CAST(v.VoteTypeId AS FLOAT)), 0) AS 'Outcome'
  FROM SuggestedEditVotes AS v  
  WHERE v.CreationDate >= ##startDate:string?2019-01-01##
    AND v.UserId != -1 -- Community
  GROUP BY v.SuggestedEditId
  HAVING COUNT(*) = 3 -- 2+1 vote
  ) AS temp

ON v.SuggestedEditId = temp.SuggestedEditId
WHERE v.VoteTypeId != temp.Outcome
ORDER BY CreationDate DESC

Enter Parameters

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