Users by year of account creation, with at least N answers

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 usersWithAnswers as
(
    select u.id, u.creationDate, count(*) answers
    from
      users u
      inner join posts p on p.ownerUserId = u.id
    where 
      postTypeId = 2 --answer      
    group by
      u.id, u.creationDate
)
select
  year(creationDate) joinYear, count(*)
from
  usersWithAnswers
where 
  answers > ##NumberOfAnswers:int##
group by
  year(creationDate)
order by
  joinYear

Enter Parameters

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