Q&A about the site for Drupal developers and administrators
DECLARE @StartDate DATETIME = '2024-05-06'; DECLARE @EndDate DATETIME = '2024-06-01'; SELECT p.Id AS [PostId], p.Body AS [AnswerBody], p.Score AS [AnswerScore], p.OwnerUserId AS [UserId], u.DisplayName AS [UserName], u.Reputation AS [UserReputation], ph.CreationDate AS [DeletionDate] FROM PostHistory ph INNER JOIN Posts p ON ph.PostId = p.Id INNER JOIN Users u ON p.OwnerUserId = u.Id WHERE ph.PostHistoryTypeId IN (12) -- Check for different types of deletions AND p.PostTypeId = 2 -- Ensure the post is an answer AND ph.CreationDate BETWEEN @StartDate AND @EndDate ORDER BY ph.CreationDate DESC;