Select answers posted by a user to closed and/or downvoted questions

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select distinct  question.Id as [Post Link], answers.CreationDate, 
answers.Id as [Post Link], answers.OwnerUserId as [User Link], 
question.Score, question.ClosedDate
-- find the answers for the user
from Posts as answers
inner join Posts as question
on question.Id = answers.ParentId
-- query the question's post history
inner join PostHistory ph
on ph.PostId = question.Id


where 
answers.OwnerUserId = '##UserId##'
and answers.PostTypeId =2 
and 
(question.ClosedDate is not null
-- check question is closed
or
question.Score <0)
-- check question downvoted


order by answers.CreationDate desc

Enter Parameters

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