select yr, mm, cnt, prev, round(100-cnt*100.00/prev, 2) a...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Portuguese Language

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

select yr, mm, cnt, prev, round(100-cnt*100.00/prev, 2) as prc
from 
(select yr, mm, cnt, lag(cnt) over (order by yr, mm) as prev
from 
(select year(CreationDate) as yr, month(CreationDate) as mm,
count(*) as cnt
from posts
where PostTypeId between 1 and 2
group by year(CreationDate), month(CreationDate)
) as x
) as y
where cnt < prev
order by yr, mm

Enter Parameters

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