select yr, mn, st, ot, round(100.0-st*100.0/ot, 3) as '%'...

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, mn, st, ot, round(100.0-st*100.0/ot, 3) as '%' from
(
select yr, mn, st, lag(st) over (order by yr,mn) as ot from
(
select year(CreationDate) as yr, month(CreationDate) as mn,
count(id) as st from posts
group by year(CreationDate), month(CreationDate)
) as x
)as z
where ot>st
order by '%' desc

Enter Parameters

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