My answers to others posts...

1

Please login or register to vote for this query.

(click on this box to dismiss)

This query returns the linked list of the answers (with accept states) you've provided to a certain user. The UserID parameter is your user ID (by default prefilled with your user ID) and the OtherUserID is the ID of a user to whom you've provided the answer(s).

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @MyUserID INT = ##UserID:int##
DECLARE @OtherUserID INT = ##OtherUserID:int##

SELECT
    Answer.Id AS [Post Link],
    Answer.Score AS [Score],
    [Answer State] =
    CASE
        WHEN Answer.Id = Question.AcceptedAnswerId THEN
            'Accepted'
        ELSE 
            '---'
    END,
    Answer.CreationDate AS [Creation Date]
FROM
    Posts Question
LEFT JOIN Posts Answer ON Question.ID = Answer.ParentId
WHERE
    Question.OwnerUserId = @OtherUserID AND
    Answer.PostTypeId = 2 AND
    Answer.OwnerUserId = @MyUserID    
ORDER BY
    Question.CreationDate
ASC

Enter Parameters

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