WITH RankedUpVotes AS ( SELECT TOP 10 COUNT(v.Id) VoteCou...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Amateur Radio

Q&A for amateur radio enthusiasts

WITH RankedUpVotes AS (
    SELECT TOP 10 COUNT(v.Id) VoteCount, v.PostId
    FROM Votes v
    WHERE v.VoteTypeId = 2
    GROUP BY v.PostId
    ORDER BY count(v.Id) DESC

),
RankedDownVotes as (
    SELECT TOP 10 COUNT(v.Id) VoteCount, v.PostId
    FROM Votes v
    WHERE v.VoteTypeId = 3
    GROUP BY v.PostId
    ORDER BY count(v.Id) DESC

)
SELECT PostId
FROM RankedUpVotes
UNION ALL
SELECT PostId
FROM RankedDownVotes;

Enter Parameters

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