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