POSTS

0

Please login or register to vote for this query.

(click on this box to dismiss)

Substrate and Polkadot Meta

Q&A for developers building blockchains with the Substrate SDK

-- Step 2: Extract posts for the selected users
WITH PostBatch AS (
    SELECT
        p.Id AS PostId,
        p.Title,
        p.Body,
        p.OwnerUserId AS UserId,
        u.DisplayName,
        t.TagName,
        u.Location,
        ROW_NUMBER() OVER (PARTITION BY p.OwnerUserId ORDER BY p.CreationDate DESC) AS PostRowNum
    FROM Posts p
    INNER JOIN Users u ON p.OwnerUserId = u.Id
    INNER JOIN PostTags pt ON p.Id = pt.PostId
    INNER JOIN Tags t ON pt.TagId = t.Id
    WHERE LOWER(t.TagName) IN ('python', 'java', 'csharp', 'php', 'javascript', 'go', 'swift') -- Programming languages filter
    AND p.OwnerUserId IN (924727,3497,267719,185921,235885,2203084,366309,3450034,724689,472034,48581,3134069,2685412,877819,1619294,718,61018,459338,4452553,525965,304588,1121841,2548721,4698790,3231194,6429072,37532,2058133,7215872,1027250,16118686,728469,11043825,2851687,4335771,2497859,6542896,115330,184234,1347816,1599,279277,1968705,3126509,855425,6891406,1429811,156982,1500392,5217712,5568405,1914902,1080742,3770235,106224,1863229,415784,14955,1338292,2435473,610569,550966,784588,8427,11238,681865,1751946,377953,75501,118068,487339,1774667,813,429846,772035,33686,81179,198633,26210,14731,19212,193619,111307,962089,65868,172999,317975,279259,513413,3661630,343,104999,8701,27020,120513,398060,5237560,3858469,1055987,62553)
   )
SELECT
    p.PostId,
    p.Title AS PostTitle,
    p.Body AS PostBody,
    p.UserId,
    P.DisplayName AS UserName,
    p.Location AS UserCountry,
    p.TagName AS PostTag
FROM PostBatch p
WHERE p.PostRowNum BETWEEN 0 AND 500;

Enter Parameters

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