select ym,cnt as curr,prev,round(100-cnt*100.00/prev,2) prc

0

Please login or register to vote for this query.

(click on this box to dismiss)

Japanese Language

Q&A for students, teachers, and linguists wanting to discuss the finer points of the Japanese language

select ym,cnt as curr,prev,round(100-cnt*100.00/prev,2) prc
from (
select ym,cnt,lag(cnt) over (order by ym) prev
from (
select year(creationDate)*100 + month(creationDate) as ym,
count(1) as cnt
from posts
where PostTypeId between 1 and 2
group by year(creationDate)*100 +month(creationDate)
) A
) A
where cnt < prev
order by ym

Enter Parameters

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