Protected questions by their number of deleted answers

1

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
  PostHistory.PostId AS [Post Link],
  PostHistory.CreationDate AS 'Date protected',
  COUNT(*) AS 'Answers',
  COUNT(CASE WHEN PostsWithDeleted.DeletionDate IS NOT NULL THEN 1 ELSE NULL END) AS 'Deleted'
FROM PostHistory
JOIN PostsWithDeleted ON PostHistory.PostId = PostsWithDeleted.ParentId
WHERE PostHistory.PostHistoryTypeId = 19 --Question Protected
GROUP BY PostHistory.PostId, PostHistory.CreationDate
ORDER BY PostHistory.CreationDate DESC

Enter Parameters

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