select top 10 Users.DisplayName, BestCommentId = BestComm...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

select top 10 Users.DisplayName,
              BestCommentId = BestComment.Id, BestCommentScore = BestComment.Score,
              WorstCommentId = WorstComment.Id, WorstCommentScore = WorstComment.Score
from Users
  join (select Comments.Id, Comments.Score, Comments.UserId
        from Comments) BestComment
    on Users.Id = BestComment.UserId
  join  (select Comments.Id, Comments.Score, Comments.UserId
        from Comments) WorstComment
    on Users.Id = WorstComment.UserId
  where BestComment.Score>0 and WorstComment.Score<0

Enter Parameters

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