Edited and re-opened 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 reopens
from
   PostHistory e 
   join PostHistory r on r.PostId=e.PostId
where
  e.CreationDate < r.CreationDate
  and (e.PostHistoryTypeId = 4 or e.PostHistoryTypeId = 5) -- Edit
  and r.PostHistoryTypeId = 11  -- Reopen
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