Closed and edited questions by month

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

select
  datepart(mm, e.CreationDate) as [month]
  ,datepart(yyyy, e.CreationDate) as [year]
  ,count(distinct e.PostId) as closes
from
   PostHistory c
   join PostHistory e on e.PostId=c.PostId
where
  c.CreationDate < e.CreationDate
  and c.PostHistoryTypeId = 10  -- Close
  and (e.PostHistoryTypeId = 4 or e.PostHistoryTypeId = 5) -- Edit
group by
  datepart(mm, e.CreationDate)
  ,datepart(yyyy, e.CreationDate)
 order by 
  datepart(yyyy, e.CreationDate)
  ,datepart(mm, e.CreationDate)

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached