Closed question roomba

3

Please login or register to vote for this query.

(click on this box to dismiss)

With great power comes great responsibility. See http://stackoverflow.com/help/roomba. The check for reopen votes is usually too conservative, but votes should expire after 14 days at the most. This query excludes questions that are duplicate targets, even though the roomba would be willing to delete them.

Woodworking

Q&A for professional and amateur woodworkers

--MaxQScore: Max Question Score
declare @qscore INT = ##MaxQScore:INT?1##
--MaxAScore: Max Answer Score
declare @ascore INT = ##MaxAScore:INT?1##

select distinct top ##Top:int?150##
    p.Id as [Post Link],
    p.Score,
    max(a.Score) as [Best Answer],
    p.CreationDate,
    p.ViewCount--,
--    crt.Name as [Close Type]
from Posts p
left join PostHistory ph on ph.postid = p.id
--left join CloseReasonTypes crt on ph.Comment = crt.Id
left join Votes v on (v.PostId = p.Id and v.VoteTypeId = '10')
left join Posts a on p.Id = a.ParentId
where 
    ph.Comment != 1 and ph.Comment != 101
    and ph.PostHistoryTypeId = 10
    and p.AcceptedAnswerId is null
    and p.ClosedDate is not null
    --and p.Tags like '%' + ##TagsContain:string?%%## + '%'
    and p.Tags not like '%' + ##TagsDoNotContain:string?identif## + '%'
    --and p.ViewCount < ##ViewCount:int?20000##
    and datediff(d, p.ClosedDate, getdate()) >= 9
    and p.Score <= @qscore
    and (p.Score > 0 or a.Score is not null)
group by p.Id, p.Score, p.CreationDate, p.ViewCount--, crt.Name
having count(v.VoteTypeId) = 0 and coalesce(max(a.Score),0) <= @ascore
order by p.Score asc, p.ViewCount asc, CreationDate

Enter Parameters

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