User Edit Count Rank

0

Please login or register to vote for this query.

(click on this box to dismiss)

Health Meta

Q&A about the site for professionals in medical and allied health fields, students of those professions, related academics, and others with a sound understanding of medicine and healthcare-related sciences

WITH RankedUsers AS (
  SELECT RANK() OVER (ORDER BY COUNT(DISTINCT ph.PostId) DESC) AS Rank,
         ph.UserId,
         COUNT(DISTINCT ph.PostId) AS EditCount  -- only count each post once
  FROM PostHistory ph
  JOIN Posts p ON ph.PostId = p.Id
              AND ph.UserId != p.OwnerUserId     -- only other people's posts
  WHERE PostHistoryTypeId IN (4,5)               -- only edits to title or body
  GROUP BY ph.UserId
)
SELECT Rank,
       UserID AS [User Link],
       EditCount
FROM RankedUsers
WHERE Rank < 100
   OR UserID = ##UserId##
ORDER BY Rank

Enter Parameters

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