Questions escaping from auto-deletion due to OWN comments

1

Please login or register to vote for this query.

(click on this box to dismiss)

Questions escaping from RemoveAbandonedQuestions script (https://meta.stackexchange.com/help/roomba) due to your OWN comments. If a question has only two comments, deleting yours will make it to be purged. If it is a question that does not deserve to be purged, then edit it, upvote it, and if possible, answer it. Linked posts: MSE - https://meta.stackexchange.com/questions/322197/modify-the-has-1-or-0-comments-requirement-for-removeabandonedquestions-scri GIS - https://gis.meta.stackexchange.com/questions/5025/what-are-the-downsides-of-not-deleting-our-own-comments/5027#5027

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT DISTINCT p.Id AS [Post Link],
                p.Score,
                p.CommentCount
FROM Posts p
INNER JOIN Comments c ON c.PostId = p.Id
WHERE p.PostTypeId = 1 -- questions.
      AND p.CreationDate < GETDATE() - 365 -- older than 365 days.
      AND (
          (p.OwnerUserId IS NULL AND p.Score < 2) -- questions with deleted owners
          OR
          (p.OwnerUserId IS NOT NULL AND p.Score < 1)
          )
      AND p.AnswerCount = 0
      AND NOT EXISTS 
      (
       SELECT *
       FROM PostHistory ph
       WHERE ph.PostId = p.Id
       AND ph.PostHistoryTypeId = 14 -- not locked
      )
      AND p.ViewCount <= DATEDIFF(DAY, p.CreationDate, GETDATE()) * 1.5
      AND p.CommentCount > 1
      AND c.UserId = '##UserId##'
ORDER BY p.CommentCount ASC; -- posts with 2 comments first (if UserID's comment is deleted, the Q is purged).

Enter Parameters

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