The distribution of views per day on questions (in blocks of size 1)
Q&A for people looking to bypass life's everyday problems with simple tricks
-- Question views-per-day count distribution -- -- An ugly query to get the distribution of views per day on questions -- (in blocks of size 1) SELECT Count(*) AS NumQuestions, FLOOR(ViewCount / DateDiff(day,CreationDate,getdate()))+1 AS ViewsPerDay FROM Posts WHERE PostTypeId = 1 GROUP BY FLOOR(ViewCount / DateDiff(day,CreationDate,getdate()))+1 ORDER BY ViewsPerDay