declare @start datetime select count(*) cnt from Posts w...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Network Engineering

Q&A for network engineers

-- Enter Query Title
-- Enter Query Description
declare @start datetime

select 
  count(*) cnt 
from 
  Posts 
where 
  CreationDate < dateadd(month,-1,getdate()) 
  and CreationDate > dateadd(month,-2,getdate()) 
  and posttypeid = 1
union all
select 
  count(*) cnt 
from 
  Posts 
where 
  CreationDate < dateadd(month,-1,getdate()) 
  and CreationDate > dateadd(month,-2,getdate()) 
  and posttypeid = 1
  and AcceptedAnswerId is not null
union all
select 
   count(*) cnt 
 from 
   Posts 
 where 
   CreationDate < dateadd(month,-1,getdate()) 
   and CreationDate > dateadd(month,-2,getdate()) 
   and posttypeid = 1
  and AcceptedAnswerId is null

  

Enter Parameters

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