Highest scored double / multiple answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- Finds questions that have multiple answers by the same user,
-- in descending order by minimum answer score.

Select Top 1000
  Q.Id as [Post Link],
  A.OwnerUserId as [User Id],
  A.OwnerUserId as [User Link],
  Count(*) as Answers,
  Min(A.Score) as MinScore,
  Max(A.Score) as MaxScore
From
  Posts as Q
  Join Posts as A On A.ParentId = Q.Id
Where
  Q.PostTypeId = 1 and A.PostTypeId = 2
  and A.OwnerUserId is not null
Group By
  Q.Id, A.OwnerUserId
Having Count(*) > 1
Order By MinScore Desc

Enter Parameters

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