Find comments that might be no longer needed

0

Please login or register to vote for this query.

(click on this box to dismiss)

Poker Meta

Q&A about the site for serious players and enthusiasts of poker

SELECT 
  p.id as [Post Link]
FROM Posts p
  JOIN Comments c ON c.PostId = p.Id
WHERE DATEDIFF(day, p.LastEditDate, c.CreationDate) >= 0
  AND c.Text LIKE '%##KeywordsInComment##%'
  AND NOT EXISTS(
    SELECT ph.PostId
    FROM PostHistory ph
    WHERE ph.PostHistoryTypeId = 10 AND ph.PostId = p.Id
  ) -- not closed
GROUP BY p.Id
ORDER by p.Id DESC

Enter Parameters

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