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

0

Please login or register to vote for this query.

(click on this box to dismiss)

Literature Meta

Q&A about the site for scholars and enthusiasts of literature

select yr, mm, cnt, prev, round(100-cnt*100.00/prev, 2) prc 
 from ( 
   select yr, mm, cnt, lag(cnt) over (order by yr, mm) 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 to main site
loading Hold tight while we fetch your results