select yearMonth,amount as currentt,previouss,round(100-a...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mythology Meta

Q&A about the site for enthusiasts and scholars of mythology and folklore

select yearMonth,amount as currentt,previouss,round(100-amount*100.00/previouss,2) procent
  from (
   select yearMonth,amount,lag(amount) over (order by yearMonth) previouss
     from (
      select year(creationDate)*100+month(creationDate) as yearMonth,
             count(id) as amount
        from posts
       
       group by year(creationDate)*100+month(creationDate)
   ) as A
  ) as A
 where amount < previouss
 order by yearMonth

Enter Parameters

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