with a as ( select top 2222100 ROW_NUMBER() OVER(ORDER BY...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Audio-Video Production Meta

Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation

with a as (
select top 2222100
ROW_NUMBER() OVER(ORDER BY convert(varchar(7), creationdate, 102)
desc) AS row,
convert(varchar(7), creationdate, 102) as postdate, count(id) as cnt
from posts
group by convert(varchar(7), creationdate, 102)
)
select a.row, a.postdate, a.cnt as curr, prev.cnt as prev,
a.cnt*100/prev.cnt as perc
from a
inner join a prev on prev.row = a.row + 1
where a.cnt < prev.cnt
order by 1;

Enter Parameters

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