with postM(yearm, monthm,countm,lastMonth) as ( select...

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

with postM(yearm, monthm,countm,lastMonth)

as

(

select year(creationdate) as yearm,

       month(creationdate) as monthm ,

       count(id) as countm, 

       lag(count(id)) over(order by year(creationdate),

       month(creationdate)) lastMonth

from posts

group by year(creationdate),month(creationdate)

)

select yearm, monthm,

       CONCAT((lastMonth-countm)/CAST(lastMonth AS DEC(12,4))*100,'%') as percents

from postM

where lastMonth>countm

order by yearm, monthm

Enter Parameters

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