;with closevoters_cte AS ( select ph.postid as pid , cv.u...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Space Exploration

Q&A for spacecraft operators, scientists, engineers, and enthusiasts

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

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