dupe voting to either your own question or a question with your answer

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select -- top 1000
       -- p.postid as [Post Link] 
       dq.owneruserid as [User Link]
     , count(*)
    -- , p.creationdate
    -- , pl.creationdate
from posthistory p
inner join postlinks pl 
        on pl.postid = p.postid
inner join posts dq on pl.relatedPostid = coalesce(dq.parentid, dq.id)
--left outer join posts da on dq.parentid = pl.relatedPostid 
                   -- or d.parentid = pl.relatedPostid
where pl.linktypeid = 3 -- dupe
and p.posthistorytypeid = 10 -- close
and p.[text] like '%:' + cast(dq.owneruserid as nvarchar) +',%'
group by dq.owneruserid
order by count(*) desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results