Napište SQL, které vypíše takové uživatele, jež nemají v profilu vyplněno pole WebsiteUrl

0

Please login or register to vote for this query.

(click on this box to dismiss)

English Language and Usage Meta

Q&A about the site for linguists, etymologists, and serious English language enthusiasts

WITH UserPosts AS (
    SELECT
        p.OwnerUserId,
        p.Id AS PostId,
        p.ViewCount,
        ROW_NUMBER() OVER (PARTITION BY p.OwnerUserId ORDER BY p.ViewCount DESC) AS Rank
    FROM
        Posts p
    WHERE
        p.CreationDate >= DATEADD(month, -3, GETDATE())
),
UsersViewedPosts AS (
    SELECT DISTINCT
        up.OwnerUserId
    FROM
        UserPosts up
    WHERE
        up.Rank <= 3
)
SELECT
    uvp.OwnerUserId,
    p.Id AS PostId,
    p.ViewCount
FROM
    UsersViewedPosts uvp
INNER JOIN
    Posts p ON uvp.OwnerUserId = p.OwnerUserId
ORDER BY
    uvp.OwnerUserId,
    p.ViewCount DESC;

Enter Parameters

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