Highest voted comments

0

Please login or register to vote for this query.

(click on this box to dismiss)

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

SELECT TOP 20 p.Score as [Answer score], c.Score as [Comment score], p.Id as [Post Link]
FROM Posts p
INNER JOIN
( SELECT c.PostId, MAX(c.Score) as [Score] -- PostId and highest voted comment score
  FROM Comments c
  WHERE c.Score > 0
  GROUP BY c.PostId) c
ON p.Id = c.PostId
WHERE p.PostTypeId = 2 -- answers
  AND p.ClosedDate is null -- not closed
  AND p.Score >= 0
ORDER BY p.Score - c.Score

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results