Find bad open questions with mediocre answers

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

-- Find bad open questions with mediocre answers
-- A single user can cause these questions to be deleted by simply downvoting.

SELECT 
    p.Id AS [Post Link],
    p.Score,
    p.CreationDate as [Asked Date],
    p.ViewCount
FROM
    Posts p
WHERE
    p.AcceptedAnswerId IS NULL
    AND
    p.PostTypeId = 1
    AND
    p.CreationDate < GETDATE() - 60
    AND
    p.CommunityOwnedDate IS NULL
    AND
    p.ClosedDate IS NULL
    AND
    p.Score <= ##MaxQuestionScore?1##
    AND
    p.Tags NOT LIKE '%catholicism%' 
    AND
    p.TAGS NOT LIKE '%biblical-basis%'
AND NOT EXISTS --Highest answer score 1 or less
    (
        SELECT *
        FROM Posts p2
        WHERE p2.ParentId = p.Id
        AND p2.Score > ##HighestAnswerScore?1##
        AND p2.PostTypeId = 2
    )
AND NOT EXISTS --Not a locked question
    (
        SELECT *
        FROM PostHistory ph
        WHERE ph.PostId = p.Id
        AND ph.PostHistoryTypeId = 14
     )  
AND NOT EXISTS --Not a duplicate, part 1
    (
        SELECT *
        FROM PostHistory ph
        WHERE ph.PostId = p.Id
        AND ph.PostHistoryTypeId = 10
        AND ph.Comment = 101
     )  
AND NOT EXISTS --Not a duplicate, part 2
    (
        SELECT *
        FROM PostHistory ph
        WHERE ph.PostId = p.Id
        AND ph.PostHistoryTypeId = 10
        AND ph.Comment = 1
        )
ORDER BY
    p.Score DESC

Enter Parameters

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