Votes on posts year on year

0

Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

--Select YEAR(v.CreationDate) year, 
--format(count(*),'0,,.00 Million') votes

--FROM Votes v
--group by YEAR(v.CreationDate)
--order by year asc

select 

t.post_year as "year",
format(t.post_count,'0,,.00 Million') posts,
format(SUM(t.post_count) OVER(ORDER BY post_year ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW),'0,,.00 Million') AS cumulative_posts
--format(count(*),'0,,.00 Million') votes

--FROM Votes v
--group by YEAR(v.CreationDate),
--order by year asc,

from 
(Select 
YEAR(p.CreationDate) post_year,
count(*) post_count
FROM
Posts p
group by YEAR(p.CreationDate) 
) t

order by t.post_year asc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results