Top users who answered and voted to close (excluding dupes)


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select top 1000
  Voter.Id as [User Link],
  count(distinct Question.Id) as [Questions Closed],
  sum(Answer.Score) as [Total Answer Score]
from Users as Voter
join Posts as Answer on Answer.OwnerUserId = Voter.Id
join Posts as Question on Question.Id = Answer.ParentId
join PostHistory as CloseEvent on CloseEvent.PostId = Question.Id 
where Answer.PostTypeId = 2
  and CloseEvent.PostHistoryTypeId = 10
  and CloseEvent.Comment not in ('1', '101') -- not a dupe
  and CloseEvent.CreationDate = Question.ClosedDate
  -- posthistory json hack from
  and CloseEvent.Text like '%"Id":'+cast(Voter.Id as nvarchar)+',%'
group by Voter.Id
order by [Questions Closed] desc

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results