Most frequent close voters on my questions

1

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers

Q&A for Drupal developers and administrators

---the cte is based on:
---https://data.stackexchange.com/mathoverflow/query/825824/close-voters-on-question

;with closevoters_cte AS (
select postid as pid
     , crt.name
     , cv.userid as uid
from posthistory ph
inner join posts p on ph.PostId=p.Id
inner join closereasontypes crt on crt.id = comment
cross apply OPENJSON(JSON_QUERY(ph.text, '$.Voters'))
       with (userid int '$.Id') cv
where (posthistorytypeid = 10) and (p.OwnerUserId=##userid##)
)

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

Enter Parameters

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