late answers that are not accepted but most likely have highest score

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT COUNT(DISTINCT(q.Id))
FROM Posts AS q
INNER JOIN Posts AS a
ON a.ParentId = q.Id
INNER JOIN Posts AS aa
ON aa.ParentId = q.Id
WHERE
    q.PostTypeId = 1
and a.PostTypeId = 2
and aa.PostTypeId = 2
and q.AcceptedAnswerId = a.Id
and q.AnswerCount >= 2
and DATEDIFF(DAY, q.CreationDate, a.CreationDate) <= 7
and DATEDIFF(DAY, q.CreationDate, aa.CreationDate) >= 30
and a.Score < aa.Score

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results