10

Is there a way I can search for questions that I have answered and that were later closed (for any reason)?

Looking at my list of answers (from my SO profile) isn't helpful as there is no visual indication whether the question is closed or not.

I am thinking this should be doable with SEDE but I am not familiar enough with the tool to write the query by myself. Could anyone help me achieve this? I have searched SEDE and meta but couldn't find any related query or question.

4
  • Ugh, I tried user:me is:a closed:yes in the on-site search. But that only brings up questions of mine which are closed. Not answers to questions that are closed. The is:a is ignored. To clarify for me it brings a self-answered question. But that's because it's the only question of mine which is closed. I tried it with MrUpsisidown's ID and it shows me questions of his without self-answers.
    – VLAZ
    Nov 28, 2022 at 11:05
  • @VLAZ indeed, this returned 3 questions of mine that are closed.
    – MrUpsidown
    Nov 28, 2022 at 11:07
  • Added clarification. Yes, it only ever searches for questions. Not even self-answers.
    – VLAZ
    Nov 28, 2022 at 11:07
  • 3
    Can closed:[0-1] apply to the parent question when is:answer is specified via search? - feature request which is from a decade ago...
    – VLAZ
    Nov 28, 2022 at 11:11

1 Answer 1

10

If you want to use SEDE to find your answers you can use this query, or click this link for a SEDE I've (just) created:

SELECT Q.Title,
       A.Id AS [Post Link]
FROM dbo.Posts A
     JOIN dbo.Posts Q ON A.ParentId = Q.Id
WHERE Q.ClosedDate IS NOT NULL
  AND A.OwnerUserId = ##UserId:int##;

Note that this will not include deleted questions (or deleted answers). Though you could reference the PostsWithDeleted table, that won't help as user information is stripped from deleted content in that table; it contains very minimal information about the post.

7
  • Thank you. It would have been perfect if we could include deleted questions too but if that's not feasible, I am fine with this one. I think it's a good way to review my own list of answers that I most likely should not have placed.
    – MrUpsidown
    Nov 28, 2022 at 11:18
  • 1
    You could still look at your deleted answers, @MrUpsidown , though like mentioned in the comments on the question, you can't filter to those which are closed. (I wish the deleted posts pages accepted the mine parameter in the URL, rather than the need to hard code the user id.)
    – Thom A
    Nov 28, 2022 at 11:23
  • mine isn't supported anywhere, AFAIK. current on the other hand is widespread: https://stackoverflow.com/users/deleted-answers/current (direct link for easy demonstration: stackoverflow.com/users/deleted-answers/current) Nov 28, 2022 at 11:31
  • Ahh, I must be misremembering the URL and getting it confused with the search feature, which uses mine, @ZoestandswithUkraine . I did stackoverflow.com/users/preferences/mine and that worked so put 2 and 2 together. Got to love "consistency". :)
    – Thom A
    Nov 28, 2022 at 11:34
  • Didn't know that was a thing. stackoverflow.com/users/preferences/current works as well though, and only current works for the generic user page: stackoverflow.com/users/current Nov 28, 2022 at 11:35
  • It looks like, in truth, that the userid (or what would be there) part of the URL is just ignored, @ZoestandswithUkraine , as stackoverflow.com/users/preferences/ksdfjghsdklfjghskldfj takes me to my preferences too... /facepalm
    – Thom A
    Nov 28, 2022 at 11:37
  • Indeed, but stackoverflow.com/users/preferences/2029983 shows me your preferences (but I'm a mod, so I get special privileges). An invalid ID redirects to my own account though, so it appears to be some weird hybrid solution that presumably exists because mods occasionally need to edit profiles? /shrug Nov 28, 2022 at 11:38

You must log in to answer this question.

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