Q&A for professional and enthusiast programmers
select *, count(*) from( select CAST( cast(DATEPART(YYYY, pl.CreationDate) as varchar) + '-' + cast(DATEPART(MM, pl.CreationDate) as varchar) + '-01' as datetime) as Mon FROM PostLinks pl JOIN (select Id, CreationDate from Posts) as tp ON tp.Id = pl.PostId JOIN (select Id, CreationDate from Posts) as mp ON mp.Id = pl.RelatedPostId WHERE pl.LinkTypeId = 3 AND tp.CreationDate < mp.CreationDate ) as X group by Mon order by Mon ASC