with postCountByMonths as (select year(creationdate) as y...


Please login or register to vote for this query.

(click on this box to dismiss)

Computer Science Educators

Q&A for those involved in the field of teaching Computer Science

with postCountByMonths as
(select year(creationdate) as year, month(creationdate) as month, coalesce(count(*), 0) as count
from posts
where posttypeid = 1 or posttypeid = 2
group by year(creationdate), month(creationdate))

select curr.year, curr.month, concat(100 - curr.count*100/prev.count, ' %') as decline
from postCountByMonths as curr join postCountByMonths as prev on
    datediff(month, DATEFROMPARTS(curr.year, curr.month, 1), DATEFROMPARTS(prev.year, prev.month, 1)) = -1
where prev.count > curr.count
order by curr.year, curr.month

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results