6

For example, https://stackoverflow.com/questions/linked/13047806?q=duplicate%3Ayes shows the questions linked to/from question with 13047806 id. Note: the query duplicate:yes in the link is ignored: the search box shows 'duplicate:yes' but the result list has questions that are not duplicates. Is there a way to enable duplicate:yes here?

Related: How do I find questions that are marked as duplicates of a given one?

2

It is not possible with the search engine on the site but you can use SEDE if you're OK if the data can be up to an week old.

This query shows the post that is linked with posts that are duplicate:

select distinct 
       pl.relatedpostid as [Post Link]
     , pl.postid as [Post Link]
from postLinks pl
inner join postlinks dl on dl.postid = pl.postid 
                       and dl.linktypeid =3 -- duplicate
where 1=1
  and pl.relatedpostid = 13047806

The PostLinks table holds rows for LinkTypes 1 (linked) and 3 (duplicate). The column relatedpostid holds the target, while the column postid holds the source. By joining the postlinks table again on postid where linktype=3 you get your desired result.

  • I don't want posts with duplicate links. I want to find posts that are duplicates of a given post. See linked posts with [duplicate] in the title – jfs Apr 5 '15 at 17:08
  • @J.F.Sebastian I think I fixed it, it now reports at least two of the three duplicates. This one isn't in the result but I think that is due to the fact that SEDE is not yet updated. – rene Apr 5 '15 at 17:55
  • It works. I've simplified it slightly (I'm not sure I understand the schema) – jfs Apr 5 '15 at 18:15
  • On closer inspection, It does not return the duplicates of a given question. – jfs Apr 5 '15 at 18:22
  • If you are expecting 13047806 to be a duplicate target then my first query was correct because there are no questions that have 13047806 as duplicate... – rene Apr 5 '15 at 19:43
  • yes. It appears @Shog9's query should be used to get the duplicates. – jfs Apr 5 '15 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .