WITH RecentPosts AS ( SELECT po.OwnerUserId, po.Title, po...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Hinduism Meta

Q&A about the site for followers of the Hindu religion and those interested in learning more about Hinduism

WITH RecentPosts AS (
    SELECT 
        po.OwnerUserId,
        po.Title,
        po.ViewCount,
        po.CreationDate,
        ROW_NUMBER() OVER (PARTITION BY po.OwnerUserId ORDER BY po.ViewCount DESC) AS PostRank
    FROM 
        Posts AS po
    WHERE 
        po.CreationDate >= DATEADD(MONTH, -3, GETDATE()) 
        AND po.ViewCount > 0
)

SELECT us.DisplayName, rp.Title, rp.ViewCount
FROM Users AS us
INNER JOIN RecentPosts  AS rp ON us.Id = rp.OwnerUserId
WHERE rp.PostRank <= 3
ORDER BY us.DisplayName, rp.ViewCount DESC;

Enter Parameters

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