number of active users per month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

select Months,count(n_posts) from
(
select Count(Id) as n_posts ,
       1.000*datepart(year,CreationDate)+
         1.000*datepart(month,CreationDate)/12 -
         1.000/24 as Months, 
       OwnerUserId 
from Posts
where PostTypeId = 2 and
      (1.000*datepart(year,CreationDate)+1.000*datepart(month,CreationDate)/12 < 
      1.000*datepart(year, GETDATE())+1.000*datepart(month, GETDATE())/12)
Group By OwnerUserId, 
1.000*datepart(year,CreationDate)+1.000*datepart(month,CreationDate)/12 - 1.000/24
) a
where n_posts > 0
group by Months
order by Months

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results