How is your favourite language/tag doing on SO (exact tag query)?


Please login or register to vote for this query.

(click on this box to dismiss)

Shows the trend for your favourite tag

Physical Fitness Meta

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

DECLARE @TagName varchar(255) = '##TagName##';

  [date] datetime,
  [count] int,

INSERT INTO @PostCountByMonth
SELECT dateadd(month, DATEDIFF(month, '', p.CreationDate), '') [date], count(*) [count]
FROM Posts p
WHERE p.Tags LIKE '%<##TagName##>%'
GROUP BY DATEDIFF(month, '', p.CreationDate)
ORDER BY DATEDIFF(month, '', p.CreationDate);

SELECT p1.[date], sum(p2.[count]) [trend]
FROM @PostCountByMonth p1 INNER JOIN @PostCountByMonth p2
  ON p1.[date] >= p2.[date]
GROUP BY p1.[date]

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results