Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles
select distinct top 1000 p.id as [Post Link],us.id as [User], p.ownerdisplayname,p.title,p.body, p.AnswerCount,a.body as answerBody, p.AcceptedAnswerId,a.id from posts p inner join posthistory ph on ph.postid = p.id inner join Posts a on p.Id = a.ParentId inner join users us on p.OwnerUserId = us.id where ( p.closeddate is not null and p.AcceptedAnswerId is not null and p.posttypeid = 1 -- Q and ph.posthistorytypeid = 10 -- closed and ph.comment in (1, 101)) -- dupe and (p.answercount > 5) ---OR ((p.posttypeid=1) and (p.answercount > 0)) order by p.Id asc