Find top editors broken down by edit types

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 100
  ph.UserId AS Id,
  ph.UserId AS [User Link],
  u.DisplayName,
  YEAR(ph.CreationDate) AS Year,
  COUNT(ph.Id) AS Total_Edits,
  COUNT(CASE WHEN ph.PostHistoryTypeId = 4 THEN 1 ELSE NULL END) AS Edits_Title,
  COUNT(CASE WHEN ph.PostHistoryTypeId = 5 THEN 1 ELSE NULL END) AS Edits_Body,
  COUNT(CASE WHEN ph.PostHistoryTypeId = 6 THEN 1 ELSE NULL END) AS Edits_Tags,
  u.Reputation
FROM PostHistory ph
  LEFT JOIN Posts p ON ph.PostId = p.Id
  LEFT JOIN Users u ON ph.UserId = u.id
WHERE 
  ph.PostHistoryTypeId in (4, 5, 6) AND
  ph.UserId <> p.OwnerUserId AND
  ph.UserId <> -1 AND
  YEAR(ph.CreationDate) = ##Year:int?2024## -- Year
  GROUP BY ph.UserId, u.displayname, u.Reputation, YEAR(ph.CreationDate)
  HAVING COUNT(ph.Id) > ##MinRep:int?2000## -- Minimum Reputation

Enter Parameters

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