Text frequency

2

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

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;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results