Archaeologist Progress / Edits


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- Title or text edits on someone else's post
-- that had been idle for 6 or more months prior

with CandidateEdits as (
    select min(ph.Id) as EditId,
           ph.PostId EditPost,
           ph.RevisionGUID as EditGUID,
           ph.CreationDate as EditDate
    from PostHistory as ph
        inner join Posts as p on ph.PostId = p.Id and OwnerUserId != UserId
    where UserId = ##UserId:int##
      and PostHistoryTypeId in (4,5) --Title/Body edits.
    group by ph.PostId, ph.RevisionGUID, ph.CreationDate
), Invalidations as (
    select EditId, count(Id) as Invalidations
    from CandidateEdits Left Outer Join PostHistory on
             EditPost = PostId
         and CreationDate between DateAdd(mm, -6, EditDate) and EditDate
         and Id < EditId
         and RevisionGUID != EditGUID
    group by EditId
select ce.EditId,
       EditPost as [Post Link],
from CandidateEdits as ce inner join Invalidations as i on ce.EditId = i.EditId

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results