1st task

0

Please login or register to vote for this query.

(click on this box to dismiss)

Vegetarianism Meta

Q&A about the site for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more

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, VoteCount
FROM RankedUpVotes
UNION ALL
SELECT PostId, VoteCount
FROM RankedDownVotes;

Enter Parameters

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