Questions and Answers per Month


Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

select [Year], 
       sum(case when PostTypeId = 1 then 1 else 0 end) Questions,
       sum(case when PostTypeId = 2 then 1 else 0 end) Answers
  select CAST(
      cast(DATEPART(YYYY, CreationDate) as varchar) + '-' + cast(DATEPART(MM, CreationDate) as varchar) + '-01'
    as datetime) [Year], 
  from Posts p
) as X
group by [Year]
order by [Year] asc

Enter Parameters

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