Top 50 Most Prolific Editors (proper)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Shows the top 50 post editors, where the user was the most recent editor (meaning the results are conservative compared to the actual number of edits).

Stack Overflow

Q&A for programmers

-- Top 50 Most Prolific Editors
-- Shows the top 50 post editors, where the user edited a post by someone eles
-- and was the most recent editor
-- (meaning the results are conservative compared to the actual number of edits).

DECLARE @UserId int = ##UserId##

SELECT rank() OVER (ORDER BY TotalEdits DESC) AS rnk
      ,*
FROM (
  SELECT TOP 200
         LastEditorUserId AS [User Link]
        ,COUNT(*) AS TotalEdits
        ,COUNT(CASE WHEN PostTypeId = 1 THEN 1 ELSE NULL END) AS QuestionEdits
        ,COUNT(CASE WHEN PostTypeId = 2 THEN 1 ELSE NULL END) AS AnswerEdits
  FROM   Posts
  WHERE  LastEditorUserId <> OwnerUserId
  GROUP  BY LastEditorUserId
  ORDER  BY CASE WHEN LastEditorUserId = @UserId THEN  0 ELSE 1 END
           ,TotalEdits DESC
  
  
  ) AS x

Enter Parameters

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