Closed, no upvoted or accepted answers, scoring <= 0, no reopen votes, no edits since closed

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

select top 300 q.Id as [Post Link]

from Posts q

join PostHistory h on h.PostId = q.Id

-- closed at least deadline days ago
where ClosedDate < getdate()-##deadline##

-- not duplicate
and PostHistoryTypeId=10
and Comment<>'1'

-- 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 upvoted answers
and not exists (select 1 from Posts a where ParentId=q.Id and Score>=1)

-- no accepted answers
and AcceptedAnswerId is null

and Score <= 0

-- pending reopen votes
and not exists (select 1 from Votes where VoteTypeId=7 and PostId=q.Id)

-- no edits since closure to question
and not exists (select 1 from PostHistory where PostHistoryTypeId in (4,5) and PostId=q.Id and CreationDate > ClosedDate)
-- ...or answers
and not exists (select 1 from PostHistory h join Posts a on a.Id=h.PostId where PostHistoryTypeId in (4,5) and a.ParentId=q.Id and h.CreationDate > ClosedDate)

order by q.CreationDate desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached