find candidates for Revival badge with a certain tag

2

Please login or register to vote for this query.

(click on this box to dismiss)

find questions older than 60 days which have no answers of score >= 2

Stack Overflow

Q&A for programmers

DECLARE @tag VARCHAR(30) = ##tag:string##

SELECT TOP 1000
    Id AS [Post Link],
    Score,
    ViewCount as Views,
    AnswerCount as Answers,
    Body,
    CreationDate
FROM Posts
WHERE
    AcceptedAnswerId IS NULL
    AND PostTypeId = 1
    AND CreationDate < GETDATE() - 60
    AND ClosedDate IS NULL
    AND Tags LIKE '%<' + LOWER(@tag) + '>%'
    AND NOT EXISTS
    (
        SELECT *
        FROM Posts p
        WHERE p.ParentId = Posts.Id
        AND p.Score >= 2
        AND p.PostTypeId = 2
    )

Enter Parameters

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