Users with edit privileges who have actually made edits.

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

-- Excludes mods.

WITH InstantEditors AS (
  SELECT
    u.*
  FROM
    PostHistory h
    INNER JOIN Posts p ON p.Id = h.PostId
    INNER JOIN Users u ON u.Id = h.UserId
  WHERE
    -- Title/tag/body edits:
    h.PostHistoryTypeId IN (4, 5, 6)
    -- Exclude suggested edits:
    AND h.RevisionGUID NOT IN (SELECT RevisionGUID FROM PostHistory WHERE PostHistoryTypeId = 24)
    -- Exclude self edits:
    AND h.UserId <> p.OwnerUserId
    -- Exclude community user:
    AND h.UserId > 0
    -- Exclude mods with < 1000 rep because we can't identify mods reliably
    -- in SEDE and thus can't include them in CanMakeEdits below:
    AND u.Reputation >= ##EditPrivilegeRep?1000##
)

SELECT
  (SELECT COUNT(DISTINCT Id) FROM InstantEditors) HaveMadeEdits,
  (SELECT COUNT(*) FROM Users WHERE Reputation >= ##EditPrivilegeRep##) CanMakeEdits,
  (SELECT COUNT(*) FROM Users) TotalUsers

Enter Parameters

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