Q&A for professional and enthusiast programmers
DECLARE @month INT = 1; WHILE @month <= 7 BEGIN SELECT COUNT(id) FROM Posts WHERE PostTypeId = 2 AND DATEPART(month,CreationDate) = @month AND DATEPART(year,CreationDate) = 2023 AND Lower(Body) LIKE '%##text##%' SET @month = @month + 1; END;