Posts per month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

select dateadd(month, datediff(month, getdate(), p.CreationDate), getdate()) Month,
       Name,
       count(*) N
from Posts p
     join PostTypes pt on pt.Id = PostTypeId
     where PostTypeId in (1,2)
group by dateadd(month, datediff(month, getdate(), p.CreationDate), getdate()), Name
order by dateadd(month, datediff(month, getdate(), p.CreationDate), getdate())

Enter Parameters

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