select datepart(year, a.CreationDate), count(*) from post...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Moderators

Q&A for community managers, administrators, and moderators

select
datepart(year, a.CreationDate),
count(*)
from
posts as a
left join posts as q on q.Id = a.ParentId
where
(1 = 1)
and a.PostTypeId = 2
and q.PostTypeId = 1
and q.ClosedDate < a.CreationDate
group by
datepart(year, a.CreationDate)

Enter Parameters

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