Posts per month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Through Feb 2011

Open Source Meta

Q&A about the site for people organizing, marketing or licensing open source development projects

-- Posts per month
-- Through Feb 2011

create table #StackPosts
(
 YearPosted int,
 MonthPosted int,
)

insert into #StackPosts (YearPosted, MonthPosted)
select 2008, 1 union all
select 2008, 2 union all
select 2008, 3 union all 
select 2008, 4 union all
select 2008, 5 union all
select 2008, 6 union all
select 2008, 7 union all
select 2008, 8 union all 
select 2008, 9  union all
select 2008, 10  union all
select 2008, 11  union all
select 2008, 12 union all
select 2009, 1  union all
select 2009, 2 union all
select 2009, 3 union all
select 2009, 4 union all
select 2009, 5 union all
select 2009, 6 union all
select 2009, 7 union all
select 2009, 8 union all
select 2009, 9 union all
select 2009, 10 union all
select 2009, 11 union all
select 2009, 12 union all
select 2010, 1 union all
select 2010, 2 union all
select 2010, 3 union all
select 2010, 4 union all
select 2010, 5 union all
select 2010, 6 union all
select 2010, 7 union all
select 2010, 8 union all
select 2010, 9 union all
select 2010, 10 union all
select 2010, 11 union all
select 2010, 12 union all
select 2011, 1 union all
select 2011, 2

select
  sp.YearPosted,
  sp.MonthPosted,
 (
  select count(p.Id)
  from Posts p
  where (datepart(year, p.CreationDate) = sp.YearPosted and datepart(month, p.CreationDate) = sp.MonthPosted)
 ) as NumPosts
from #StackPosts sp

Enter Parameters

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