how can I list questions which has (one or more answers) or marked as duplicate?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Lifehacks

Q&A for people looking to bypass life's everyday problems with simple tricks

select distinct top 500 p.id as [Post Link], p.id as [Post ID], 
a.OwnerUserId as [User ID],a.OwnerDisplayName as [User Name],p.title as [Question Titles],
p.body as [Question Body], p.AnswerCount as [Total Answers],a.id as [Answer ID],
a.body as [Answers], a.LastEditorUserId as [Author ID],a.LastEditorDisplayName as [Author Name]
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
inner join Comments cm
   on cm.postid = p.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

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results