Q&A for professional and enthusiast programmers
select top 300 q.Id as [Post Link] from Posts q join PostHistory ph on ph.PostId=q.Id -- closed at least deadline days ago where ClosedDate < getdate()-##deadline## -- not closed as a duplicate and PostHistoryTypeId=10 and Comment<>'1' -- no upvoted answers and not exists (select 1 from Posts a where ParentId=q.Id and Score>=1) -- no accepted answer and AcceptedAnswerId is null -- not locked and isnull((select top 1 PostHistoryTypeId from PostHistory where PostId=q.Id and PostHistoryTypeId in (14,15,35) order by CreationDate desc),0) not in (14,35) -- no reopen votes and not exists (select 1 from Votes where VoteTypeId=7 and PostId=q.Id) order by q.CreationDate desc