Questions with an accepted answer older and lower score than the highest answer

0

Please login or register to vote for this query.

(click on this box to dismiss)

Science Fiction and Fantasy

Q&A for science fiction and fantasy enthusiasts

SELECT p1.Id, p1.Title, acc.Score as AcceptedScore, acc.CreationDate as AcceptedCreatedOn, MAX(ans.Score) as HighestScore, ans.CreationDate as HighestCreatedOn,
CONCAT('https://gaming.stackexchange.com/questions/', p1.Id) as URL
FROM POSTS p1 
  INNER JOIN POSTS acc on acc.Id = p1.AcceptedAnswerId
  INNER JOIN POSTS ans on ans.ParentId = p1.Id and ans.PostTypeId = 2 and ans.Id != acc.Id
WHERE p1.PostTypeId = 1
GROUP BY p1.Id, p1.Title, acc.Score, acc.CreationDate, ans.CreationDate
HAVING  MAX(ans.Score) > acc.Score and ans.CreationDate > acc.CreationDate
ORDER BY p1.id;

Enter Parameters

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