Q&A about the site for SharePoint enthusiasts
-- 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 (472375, 551406, 23341, 155861, 797, 10583, 1897, 405143, 314661, 58129, 111435, 23339, 1950295, 2396539, 174261, 20126, 53212, 84201, 19851, 248521, 70157, 474189, 567751, 139985, 179630, 1134940, 390388, 221955, 4766534, 6433023, 5380, 78000, 41211, 4248328, 4022390, 1190388, 1776916, 1860929, 631612, 3068190, 5648954, 46297, 168501, 474349, 776084, 63810, 4468648, 3218114, 3293881, 913184, 36036, 3418066, 13163, 414184, 1258398, 1011959, 1294207, 424721, 195835, 617801, 661933, 1748599, 1823841, 5768908, 1501794, 493, 9990, 497043) ) 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;