Q&A about the site for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry
select p.id as [Post Link] , max(c.creationdate) as [Last Commented] , max(ph.creationdate) as [Last OP Edit] , max(p.closeddate) as [Closed] from comments c join posts p on c.postid = p.id and c.userid <> p.owneruserid and p.lasteditdate > c.creationdate join posthistory ph on p.id = ph.postid and p.owneruserid = ph.userid and ph.creationdate > c.creationdate join votes v on p.id = v.postid and v.creationdate < ph.creationdate where c.userid = ##userid## and p.posttypeid = 1 and ph.posthistorytypeid = 5 and v.votetypeid = 3 group by p.id order by max(ph.creationdate) desc