COMMENTS

0

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

-- Step 3: Extract comments for the posts in batches
WITH CommentBatch AS (
    SELECT
        c.Id AS CommentId,
        c.Text,
        p.Title,
        p.OwnerUserId AS UserId,
        u.DisplayName,
        u.Location,
        t.TagName,
        ROW_NUMBER() OVER (PARTITION BY p.Id ORDER BY c.CreationDate DESC) AS CommentRowNum
    FROM Comments c
    INNER JOIN Posts p ON c.PostId = p.Id
    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 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
    cb.CommentId,
    cb.Title AS CommentTitle,
    cb.Text AS CommentText,
    cb.UserId,
    cb.DisplayName AS UserName,
    cb.Location AS UserCountry,
    cb.TagName AS CommentTag
FROM CommentBatch cb
WHERE cb.CommentRowNum BETWEEN 0 AND 500;

Enter Parameters

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