Unclosed questions with only zero-score answers, for specified [language] tag

2

Please login or register to vote for this query.

(click on this box to dismiss)

Code Review

Q&A for peer programmer code reviews

-- This query is designed to suggest answers that might deserve upvotes.
-- It lists questions with only zero-score answers.  The top 100 results
-- are returned, sorted mainly by the question score. Closed questions
-- are excluded.


SELECT TOP ##NumberOfQuestions:int?200##
        Questions.Id AS [Post Link],
        Questions.Tags AS [Tags],
        Questions.Score AS Score,
        Questions.ViewCount AS Views,
        CONVERT(VARCHAR, Questions.CreationDate, 7) AS [Date Asked],
        COUNT(Answers.Id) AS [# Answers],
        'site://a/' + CAST(Questions.AcceptedAnswerId AS NVARCHAR) + '|' + nchar(0x2713) AS [Accepted Answer]
    FROM Posts AS Questions
        JOIN Posts AS Answers
            ON Answers.ParentId = Questions.Id
    WHERE
    Questions.Tags LIKE '%<' + ##TagName:string## + '>%' AND
        Questions.ClosedDate IS NULL AND
        NOT EXISTS (
            SELECT Id
                FROM Posts AS Answers
                WHERE
                    Answers.ParentId = Questions.Id AND
                    Answers.Score <> 0
        )
    GROUP BY Questions.Id, Questions.AcceptedAnswerId, Questions.Tags, Questions.Score, Questions.ViewCount, Questions.CreationDate
    HAVING COUNT(Answers.Id) > 0
    ORDER BY Questions.Score DESC, COUNT(Questions.AcceptedAnswerId), COUNT(Answers.Id) DESC, Questions.ViewCount DESC, Questions.CreationDate DESC;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results