select top 10 Users.DisplayName, BestComment.Id, BestComm...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Philosophy Meta

Q&A about the site for those interested in the study of the fundamental nature of knowledge, reality, and existence

select top 10 Users.DisplayName,
              BestComment.Id, BestComment.Score,
              WorstComment.Id, WorstComment.Score
from Users
  join (select top 1 Comments.Id, Comments.Score, Comments.UserId
        from Comments
        order by Comments.Score) BestComment
    on Users.Id = BestComment.UserId
  join  (select top 1 Comments.Id, Comments.Score, Comments.UserId
        from Comments
        order by Comments.Score desc) WorstComment
    on Users.Id = WorstComment.UserId

Enter Parameters

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