Find all your unappreciated answers.
Q&A for programmers
-- Answers with best score, but question has no accepted answer
-- Find all your unappreciated answers.
SELECT a1.id as [Post Link],
a1.CreationDate, a1.Score, Scores.maxScore as [Next Best], a1.lastActivityDate, a1.CommentCount
FROM Posts a1
INNER JOIN Posts q
ON q.ID = a1.ParentID
INNER JOIN (SELECT MAX(p.Score) as maxScore,p.ParentID as ID FROM Posts p WHERE p.OwnerUserId<>##UserId## GROUP BY p.ParentId) Scores
ON a1.ParentID = Scores.ID
AND q.AcceptedAnswerID IS NULL
AND Scores.maxScore < a1.Score
ORDER BY a1.lastActivityDate DESC
Error: looks like you typed in the wrong words - try again