1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select count(owneruserid) as 'user count', dy as 'year'
from 
(
select owneruserid, datepart(year,creationdate) dy
from posts
group by owneruserid, datepart(year,creationdate)
having
count(case when posttypeid = 1 then 1 end) = 0
and
count(case when posttypeid = 2 then 1 end) = 0
) x
group by x.dy

Enter Parameters

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