Top 50k posts

0

Please login or register to vote for this query.

(click on this box to dismiss)

Sports

Q&A for participants in team and individual sport activities

-- Order all posts by the view count in descending order
-- And pull top 50,000 distinct posts
-- In the name of eficiency - pull only the relevant columns
SELECT DISTINCT TOP 150000 Id
, Score
, ViewCount
, REPLACE(Title,',','')
, REPLACE(Body,',','')
, Tags
, OwnerUserId
, OwnerDisplayName
FROM Posts
WHERE ViewCount <= 56799 -- ViewCount of the last record in first 50k
AND Id <> 9375354
ORDER BY ViewCount DESC;

Enter Parameters

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