WITH ranked_posts AS ( SELECT p.OwnerUserId, p.Id, p.View...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Language Learning

Q&A for students, teachers, polyglots, and anyone interested in the techniques of second-language acquisition

WITH ranked_posts AS (
    SELECT 
        p.OwnerUserId,
        p.Id,
        p.ViewCount,
        RANK() OVER (PARTITION BY p.OwnerUserId ORDER BY p.ViewCount DESC) AS rank
    FROM 
        posts p
)
SELECT 
    OwnerUserId,
    Id,
    ViewCount
FROM 
    ranked_posts
WHERE 
    rank = 1
ORDER BY 
    OwnerUserId;

Enter Parameters

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