Q&A for serious players and enthusiasts of chess
SELECT datepart(week,p.CreationDate) as [date], Name, count(*) N, count(iif(Name = 'Answer', 1, 0)) - count(iif(Name = 'Question', 1, 0)) FROM Posts p join PostTypes pt on p.PostTypeId = pt.Id join Posts q on isnull(p.ParentId, p.Id) = q.Id WHERE p.PostTypeId in (1,2) AND p.CreationDate BETWEEN '##year?2014##'+'-01-01' AND '##year##'+'-12-31' and q.ClosedDate is null and p.Score >= ##score?0## and q.Score >= ##score## GROUP BY datepart(week,p.CreationDate), Name ORDER BY datepart(week,p.CreationDate), Name