duplicate titles with link

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

with duplicates as (
  select
    rtrim(p.Title) collate SQL_Latin1_General_CP1_CI_AI dupTitle,
    count(p.Title) dupCount
  from Posts p
  group by rtrim(p.Title) collate SQL_Latin1_General_CP1_CI_AI
  having count(p.Title) > 1
)
select p.Tags,
       'site://q/' + cast(p.Id as nvarchar) + '|' + p.title [Link],
       dupCount,
       p.Score [Score],
       p.AnswerCount [Answers],
       p.LastEditDate [Last Edit],
       p.ClosedDate [Closed]
from Posts p
join duplicates on rtrim(p.Title) = dupTitle collate SQL_Latin1_General_CP1_CI_AI
inner join posttags pt on pt.postid = p.id
inner join tags t on t.id = pt.tagid
where p.PostTypeId = 1
and t.tagname in (select value from string_split(##tagnames:string?java;ruby##,';'))
and p.closeddate is not null
order by dupCount desc, dupTitle asc

Enter Parameters

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