Deleted post stats

1

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

SELECT
  'Deleted Questions' AS Type,
  COUNT(*) AS Count
FROM PostsWithDeleted
WHERE PostTypeId = 1 AND DeletionDate IS NOT NULL

UNION

SELECT
  'Not deleted questions with deleted answers' AS Type,
  COUNT(DISTINCT Q.Id) AS Count
FROM PostsWithDeleted Q, PostsWithDeleted A
WHERE
  A.ParentId = Q.Id AND Q.DeletionDate IS NULL AND A.DeletionDate IS NOT NULL

UNION

SELECT PostTypes.Name AS Type, COUNT(*) AS Count
FROM PostsWithDeleted, PostTypes
WHERE
  PostsWithDeleted.DeletionDate IS NOT NULL
  AND
  PostsWithDeleted.PostTypeId = PostTypes.Id
GROUP BY PostTypes.Name

ORDER BY Type;

Enter Parameters

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