Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs
with pclosed as ( select p.id as id from posts p inner join PostHistory ph on ph.postid = p.id where p.posttypeid = 1 -- q and ph.PostHistoryTypeId = 10 -- closed and ph.comment = 101 -- as duplicate ), aclosed as ( select a.id as id from posts a inner join pclosed on a.ParentId = pclosed.id ) select * from aclosed