Phoenix Suns SQL Assessment

0

Please login or register to vote for this query.

(click on this box to dismiss)

IT Security Meta

Q&A about the site for information security professionals

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 main site
loading Hold tight while we fetch your results