select t2.d_year, t2.d_month, Round(100.0 * t2.diff / t2....


Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers

Q&A for Drupal developers and administrators

select t2.d_year, t2.d_month, Round(100.0 * t2.diff / t2.prev_month, 2) as Percentage


  select t1.d_year, t1.d_month, count( as d_count,
  LAG(count( OVER (ORDER BY t1.d_year, t1.d_month) AS prev_month, 
  count( - (LAG(count( OVER (ORDER BY t1.d_year, t1.d_month)) as diff
    select id, YEAR(CreationDate) as d_year, MONTH(CreationDate) as d_month
    from posts
  ) t1
  group by t1.d_month, t1.d_year
) t2
where Round(100.0 * t2.diff / t2.prev_month,2) < 0
order by t2.d_year, t2.d_month

Enter Parameters

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