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


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) percentt
  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

Switch sites:
loading Hold tight while we fetch your results