Q&A for professional and enthusiast programmers
SELECT datepart(week,p.CreationDate) as [date], Name, count(*) N 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 datepart(year, p.CreationDate) = ##year?2014## and q.ClosedDate is null and p.Score >= 0 and q.Score >= ##score?0## GROUP BY datepart(week,p.CreationDate), Name ORDER BY datepart(week,p.CreationDate), Name