Reciprocal accepting of answers for user questions


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

with questions as (
   p1.owneruserid as question_userid
 , p2.owneruserid as answer_userid
 , -- to view sample ids
from posts p1
inner join posts p2 on -- to fetch answer post
  p1.acceptedanswerid =
select top 5 
    -- distinct -- unique pairs (may throw timeout with distinct and no top)
    q1.question_userid as userid1
  , q1.answer_userid as userid2
  ,, -- to view sample ids
from questions q1
inner join questions q2 on
      q1.question_userid = q2.answer_userid -- accepted answer from someone
  and q1.answer_userid = q2.question_userid -- who also accepted our answer
  and q1.question_userid <> q1.answer_userid -- and we aren't self-accepting

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results