New answerers by year

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

with answerers_year as
(

select u.Id UserId, 
       (select year(min(CreationDate)) 
        from PostsWithDeleted 
        where OwnerUserId = u.Id
              and Score > 0
              and PostTypeId = 2) start,
       (select year(max(CreationDate)) 
        from PostsWithDeleted 
        where OwnerUserId = u.Id
              and Score > 0
              and PostTypeId = 2) retire
from Users u
group by u.Id
)

/**
select r.retire year, 
count(r.retire) retiring_answerers

from answerers_year r
where r.retire is not null
group by r.retire
order by r.retire
--**/
--/**
select a.start year, 
count(a.start) new_answerers
from answerers_year a
where a.start is not null
group by a.start
--**/

Enter Parameters

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