Top close/reopen voters


Please login or register to vote for this query.

(click on this box to dismiss)

Bicycles Meta

Q&A about the site for people who build and repair bicycles, people who train cycling, or commute on bicycles

---the cte is taken from here:
;with closevoters_cte AS (
select postid as pid
     , cv.userid as uid
from posthistory ph
cross apply OPENJSON(JSON_QUERY(ph.text, '$.Voters'))
       with (userid int '$.Id') cv
where posthistorytypeid = ##type?11##

SELECT TOP(##num?500##)
  RANK() OVER(ORDER BY Count(pid) DESC) AS Rank,
  uid AS [User Link],
  COUNT(pid) AS [Count]
FROM closevoters_cte

----- If PostHistoryTypeId in (10,11,12,13,14,15,19,20,35) this column will contain a JSON encoded string with all users who have voted for the PostHistoryTypeId
---10 = Post Closed - post voted to be closed
---11 = Post Reopened - post voted to be reopened
---12 = Post Deleted - post voted to be removed
---13 = Post Undeleted - post voted to be restored
---14 = Post Locked - post locked by moderator
---15 = Post Unlocked - post unlocked by moderator
---19 = Question Protected - question was protected by a moderator.
---20 = Question Unprotected - question was unprotected by a moderator.
---35 = Post migrated away - replaces id 17

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results