Top duplicate closevoters


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

--modification of rene's query
;with closevoters_rank as
select row_number() over(order by count(*) desc) [row]
     , userid
     , count(*) as cnt
select json_value(text, concat('$.Voters[', keys.value, '].Id')) userid
      , postid
from posthistory
cross apply string_split('0,1,2,3,4',',') keys
where posthistorytypeid = 10 and comment=101 -- closed as duplicate
) closevoters
where userid is not null
and userid > 0
group by userid

select '.'
     , row
     , 'site://users/' + userid + '|' + u.displayname
     , cnt
from closevoters_rank
inner join users u on = userid
order by 1, 2

Enter Parameters

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