Questions closed as duplicate with multiple targets

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

select
  ph.PostId as [Post Link],
  JSON_QUERY(Text, '$.OriginalQuestionIds') as [Target Ids],
  JSON_QUERY(Text, '$.Voters') as [Voter Ids]
from
  posthistory as ph
where
  (1=1)
  and ph.PostHistoryTypeId = 10
  --OriginalQuestionIds presence indicates duplicate closure
  and ph.Text like '{"OriginalQuestionIds"%'
  --multiple targets will have a comma as the value is an array
  and charindex(',',JSON_QUERY(Text, '$.OriginalQuestionIds')) > 0
order by
  len(JSON_QUERY(Text, '$.OriginalQuestionIds')) desc

Enter Parameters

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