select year, month, (100 * (curr_month_posts - prev_month...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

select year, month, (100 * (curr_month_posts - prev_month_posts)/prev_month_posts) as percentage_decrease
from
(
select year(creationdate) as year, month(creationdate) as month, count(*) as curr_month_posts,
lag(count(*)) over (order by year(creationdate), month(creationdate)) prev_month_posts
from posts
group by year(creationdate), month(creationdate)
) x
where curr_month_posts < prev_month_posts

Enter Parameters

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