Questions with most delete votes

1

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
  p.Id as [Post Link],
  max(p.Score) as [Score],
  max(p.AnswerCount) as [Answers],
  count(v.Id) as [Delete Votes]
from posts p 
  inner join votes v 
    on v.PostId=p.Id
where 
  v.VoteTypeId=10 -- delete votes
  and p.PostTypeId=1 -- questions only 
  and not exists ( -- exclude locked posts
    select 1
    from
      PostHistory ph
    where
      ph.PostId = p.id
      and ph.PostHistoryTypeId = 14
  )
group by p.Id
order by [Delete Votes] desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results