Unanswered questions 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

select year(q.CreationDate) year,
sum(iif(a.Id is null, 1, 0)) unanswered
from Posts q
     left outer join Posts a 
          on a.ParentId = q.Id
          and a.OwnerUserId <> q.OwnerUserId
where q.PostTypeId = 1
      and a.CreationDate < q.CreationDate + 3
group by year(q.CreationDate)
order by year(q.CreationDate)

Enter Parameters

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