Q&A for administrators and users of the CiviCRM Constituent Relationship Management software
SELECT date1, count(id) as cnt FROM ( SELECT FORMAT (d.CreationDate, 'yy-MM') as [date1], (d.Id) as id FROM Posts d -- d=duplicate LEFT JOIN PostHistory ph ON ph.PostId = d.Id LEFT JOIN PostLinks pl ON pl.PostId = d.Id LEFT JOIN Posts o ON o.Id = pl.RelatedPostId -- o=original WHERE d.PostTypeId = 1 -- 1=Question AND pl.LinkTypeId = 3 -- 3=duplicate AND ph.PostHistoryTypeId = 10 -- 10=Post Closed ) as t1 group by date1 order by date1