Questions with two answers from the same user

0

Please login or register to vote for this query.

(click on this box to dismiss)

List questions that have two or more answers posted by the same user. Community wiki answers are excluded. FIXME: if a user has posted 3 or more answers, each answer pair is listed, resulting in Θ(n²) output. Fortunately this is rare.

Stack Overflow

Q&A for professional and enthusiast programmers

select
  a.ParentId as [Post Link],
  'site://a/' + cast(a.Id as varchar(9)) + '|' + cast(a.CreationDate as varchar(19)) [Answer 1],
  a.Score AS [Score],
  'site://a/' + cast(b.Id as varchar(9)) + '|' + cast(b.CreationDate as varchar(19)) [Answer 2],
  b.Score AS [Score],
  a.OwnerUserId AS [User Link]
from Posts a, Posts b
where a.ParentId = b.ParentId
  and a.Id < b.Id
  and a.OwnerUserId = b.OwnerUserId
  and a.CommunityOwnedDate is null
  and b.CommunityOwnedDate is null
order by a.ParentId ASC

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results