8

Looking at this page, I don't see any shortcuts for searching questions where the OP self-answered.

I'm trying to search specifically where the OP added details to the original question by adding an answer rather than editing the original post. Admittedly, these get flagged pretty early, but occasionally, they get missed.

But I think there should be a way to do this.

Is it possible to search for posts where the asker of a question has also answered the question?

4

Yes, it is possible to find all of the questions where the OP has self answered

SELECT
    P2.Id AS [Post Link], 
    P1.Score as AnswerScore,
    P2.Score as QuestionScore,
    p2.ViewCount,
    p2.FavoriteCount,

    P1.OwnerUserID AS [User Link]

FROM Posts as P1, Posts as P2
WHERE P2.Id = P1.ParentId and --Join of Questions with Answers--
      P2.PostTypeId = 1 and -- P2 Contains Questions --
      P1.PostTypeId = 2  -- P1 contains Answers --
      AND P2.OwnerUserID = P1.OwnerUserID -- Poster of answer and question are the same

To find the ones where the user answered the question right away with the "Answer your own question" link, you add another and statement to check that the id of the question is exactly one more than the id of the answer.

AND CAST (P2.id AS INT) +1 =  CAST (P1.id AS INT)

For your purposes, you would want the ones where the self-answer happened later, so you would want to change that line to not be a direct self answer.

AND   CAST (P2.id AS INT) +1 !=  CAST (P1.id AS INT)

You must log in to answer this question.

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