Highest voted comments


Please login or register to vote for this query.

(click on this box to dismiss)

Robotics Meta

Q&A about the site for professional robotic engineers, hobbyists, researchers and students

SELECT TOP 20 p.Score as [Answer score], c.Score as [Comment score], p.Id as [Post Link]
FROM Posts p
( 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

Switch sites:
loading Hold tight while we fetch your results