Is it possible to write a query that fetches just the question and the accepted answer while applying the ... userId of the user who posted the accepted answer... as the filter.

To be clearer, the query should find all the questions and just the accepted answer... wherein the accepted answer was in fact posted by me.


select question,acceptedAnswer from posts where acceptedAnswerPoster = @me

1 Answer 1



You can narrow down the columns you want, starting with this:

    FROM Posts q
    INNER JOIN Posts a ON q.AcceptedAnswerId = a.Id
    WHERE a.OwnerUserId = ##UserId##

Note that in the Data Explorer, there's no concept of "me," as the interface knows nothing about your accounts on the Stack Exchange sites.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .