Post count, view count, view/post ratio per day


Please login or register to vote for this query.

(click on this box to dismiss)

History of Science and Math

Q&A for people interested in the history and origins of science and mathematics

DECLARE @TagName nvarchar (25) = '##TagName##'

   CAST(p.CreationDate AS date) AS pdate,
   COUNT(*) AS nposts_per_day,
   SUM(p.ViewCount) AS nviews_per_day,
   SUM(p.ViewCount)/COUNT(*) AS view_post_ratio
   FROM Tags 
   JOIN PostTags AS pt ON Tags.Id = pt.TagId 
   JOIN Posts AS p ON pt.PostId = p.Id
   WHERE Tags.TagName = @TagName
   GROUP BY CAST(p.CreationDate AS date)
   ORDER BY pdate DESC

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results