Close-edit-reopen cycle

0

Please login or register to vote for this query.

(click on this box to dismiss)

Close votes and what happens afterwards

Open Source Meta

Q&A about the site for people organizing, marketing or licensing open source development projects

-- Close-edit-reopen cycle

select
  closed.PostId as PostId,
  closed.CreationDate as CloseDate,
  (select
    min(opened.CreationDate)
    from PostHistory opened
    where opened.PostId = closed.PostId
      and opened.CreationDate > closed.CreationDate
      and opened.PostHistoryTypeId = 11) as ReopenDate,
  (select
    count(*)
    from PostHistory edited join PostHistory opened on edited.PostId = opened.PostId
    where edited.PostId = closed.PostId
      and edited.CreationDate > closed.CreationDate
      and edited.CreationDate < opened.CreationDate
      and edited.PostHistoryTypeId = 5
      and opened.PostHistoryTypeId = 11) as EditedCount
  from PostHistory closed
  where PostHistoryTypeId = 10

Enter Parameters

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