Phoenix Suns SQL Assessment

0

Please login or register to vote for this query.

(click on this box to dismiss)

Anime and Manga

Q&A for anime and manga fans

SELECT OwnerUserId, Id
FROM Posts
ORDER BY OwnerUserId DESC;
WITH RankedPosts AS (
    SELECT 
        OwnerUserId AS user_id,
        COUNT(Id) AS post_count,
        ROW_NUMBER() OVER (ORDER BY COUNT(Id) DESC) AS row_num
    FROM 
        Posts
    GROUP BY 
        OwnerUserId
)
SELECT 
    user_id,
    post_count
FROM 
    RankedPosts
WHERE 
    row_num <= 15;

Enter Parameters

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