Popular questions with the most down votes

1

Please login or register to vote for this query.

(click on this box to dismiss)

This query shows questions where at least 10 people have voted up and 2 people have voted down, ordered by total down votes.

Ask Different

Q&A for power users of Apple hardware and software

SET NOCOUNT ON

DECLARE @VoteStats TABLE (PostId int, up int, down int) 

INSERT @VoteStats
SELECT
    PostId, 
    up = SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END), 
    down = SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END)
FROM Votes
WHERE VoteTypeId in (2,3)
GROUP BY PostId

SET NOCOUNT OFF

SELECT TOP 100 p.id AS [Post Link], up AS [Up-votes], down AS [Down-votes] FROM @VoteStats 
join Posts p ON PostId = p.Id
WHERE
    up > 9
    AND down > 1
    AND p.PostTypeId = 1
    AND p.ClosedDate IS NULL
ORDER BY down DESC

Enter Parameters

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