Q&A about the site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation
;with times_cte AS ( SELECT p.Id AS pid, p.CreationDate AS cre, ph.CreationDate AS hot, FLOOR(CAST(DATEDIFF(minute, p.CreationDate, ph.CreationDate) AS decimal)/##interval?10##) AS time FROM PostHistory ph INNER JOIN Posts p ON ph.PostId=p.Id WHERE ph.PostHistoryTypeId=52 ---52 = Question became hot network question ) SELECT time, COUNT(pid) AS Count FROM times_cte GROUP BY time ORDER BY time