declare @posts table ( [Year] int, Posts bigint ) insert...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Different

Q&A for power users of Apple hardware and software

declare @posts table (
   [Year] int,
   Posts bigint
)

insert into @posts ( [Year], Posts )
  select year(P.CreationDate), count(*) 
  from Posts as P 
  group by year(P.CreationDate)

select * from @posts

select 
year(V.CreationDate) as [Year],
count(V.Id)
from 
Votes as V
where
V.VoteTypeId in (12)
group by
year(V.CreationDate)
order by
[Year]
asc

Enter Parameters

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