What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

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.

pseudo-query:

select question,acceptedAnswer from posts where acceptedAnswerPoster = @me
share|improve this question

1 Answer 1

up vote 3 down vote accepted

Yep.

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

SELECT *
    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.

share|improve this answer

You must log in to answer this question.

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