Mysterious closures by a single non-moderator

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT 
  ph.Id, 
  pht.Name,
  ph.PostId, 
  ph.CreationDate, 
  ph.UserId, 
  ph.Comment, 
  ph.Text 
FROM 
  PostHistory AS ph
  LEFT OUTER JOIN Posts AS p
    ON ph.PostId = p.Id
  LEFT OUTER JOIN PostHistoryTypes AS pht
    ON ph.PostHistoryTypeId = pht.Id
WHERE
  LEN(ph.Text) - LEN(REPLACE(ph.Text, '"Id"', '')) = 1*4
  AND ph.PostHistoryTypeId NOT IN (19, 20)
  AND NOT (ph.PostHistoryTypeId IN (12, 13) AND p.OwnerUserId = ph.UserId)
  
-- 12 = Post Deleted
-- 13 = Post Undeleted
-- 19 = Question Protected
-- 20 = Question Unprotected

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results