Outscored accepted answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Show questions whose accepted answer is not the highest-scored one.

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
  q.Id As [Post Link],
  Max(a.Score) AS [Acc. score],
  Max(b.Score) AS [Top. score],
  Count(*) AS [# outscoring],
  Max(DateDiff(day, a.CreationDate, b.CreationDate)) AS [Days to first outscorer]
  --Max(a.CreationDate) AS [Accepted answer date],
  --Max(b.CreationDate) AS [Top answer date]
FROM Posts q, Posts a, Posts b
WHERE q.AcceptedAnswerId = a.Id
  AND b.ParentId = q.Id
  AND b.Score > a.Score
GROUP BY q.Id
ORDER BY Max(b.Score) DESC

Enter Parameters

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