select day_/100 as year_, day_ %100 as month_, number, p...

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 top 100 * from posttypes

select day_/100 as year_, day_ %100 as month_, number, prev, (prev-number)*100/prev as prc
from (select day_, number, lag(number) over (order by day_) prev
from (select DATEPART(dd,creationDate) as day_,
count(*) as number from posts
where posttypeid=1 or posttypeid=2
group by DATEPART(dd,creationDate)
) A
) A
where number < prev
order by day_

Enter Parameters

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