Number of posts per month

1

Please login or register to vote for this query.

(click on this box to dismiss)

This is a monthly tally. Therefore, please note that incomplete months will have a lower number of posts.

Programming Language Design and Implementation

Q&A for designers and implementers of computer programming languages

-- PostTypeId
--   1 = Question
--   2 = Answer

with T as (
  select 
    dateadd(month, dateDiff(month, 0, CreationDate), 0) as Month,
    PostTypeId
  from Posts
)
select 
  Month, 
  count(*) as 'Posts (Questions + Answers)',
  count(case when PostTypeId = 1 then 1 end) as 'Questions',
  count(case when PostTypeId = 2 then 1 end) as 'Answers'
from
  T
where
  PostTypeId in (1, 2)
  and
  -- Start: From ( First day of the month. e.g. 2008-08-01 ):
  -- End: To ( Last day of the month. e.g. 2024-06-30 ):
  Month between ##Start:string## and ##End:string##
group by Month
order by Month;

Enter Parameters

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