select p.id as [Post Link] , p.closeddate , a.id as [Post...

0

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 p.id as [Post Link]
     , p.closeddate
     , a.id as [Post Link]
     , a.creationdate [created on]
     , v.creationdate [undeleted on]
from posthistory ph
inner join posts p on ph.postid = p.id
inner join posts a on a.parentid = p.id -- and the answers
inner join votes v on v.postid = a.id -- and the answer votes
where ph.posthistorytypeid = 10 -- question is closed
and ph.comment in ( 101 , 1)  -- as duplicate
and p.answercount > 0 -- has answers
and p.closeddate is not null -- is still closed
and v.votetypeid = 11 -- undeleted answer
and v.creationdate > p.closeddate -- undeleted after the question was closed

Enter Parameters

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