Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs
;with firstpostids_cte as ( SELECT MIN(Id) AS MinId, OwnerUserId FROM Posts WHERE PostTypeId=1 GROUP BY OwnerUserId ) , firstpostsclosed_cte as ( SELECT p.Id, p.CreationDate AS cre, p.ClosedDate AS clo FROM firstpostids_cte fp JOIN Posts p ON fp.MinId=p.Id ) SELECT number = ROW_NUMBER() OVER (ORDER BY format(cre, 'yyyy-MM')), format(cre, 'yyyy-MM'), ROUND((COUNT(clo))*100.0/(COUNT(*)),2) AS percentage FROM firstpostsclosed_cte GROUP BY format(cre, 'yyyy-MM') ORDER BY format(cre, 'yyyy-MM')