Paging through large data sets

0

Please login or register to vote for this query.

(click on this box to dismiss)

Refer to https://stackoverflow.com/questions/51884419/pagination-for-data-explorer-results

Sound Design

Q&A for sound engineers, producers, editors, and enthusiasts

-- StartRow: Starting row for paging
-- EndRow: Ending row for paging (Max 50K rows at a time)
--
-- Note: Magic column names bust query on Stack Overflow data set!
WITH allData AS (
    SELECT
                ROW_NUMBER() OVER (ORDER BY P.creationdate) AS row
                , P.id
                , P.posttypeid
                , P.acceptedanswerid
                , P.score
                , P.viewcount
                , P.body
                , P.title
                , P.creationdate
                , P.tags
                , P.owneruserid
                , P.answercount
    FROM        Posttags    AS PT
    JOIN        Posts       AS P    ON PT.postid = P.id
    WHERE       PT.tagid    = 17  --  tag [scala]
)
SELECT      *
FROM        allData
WHERE       row    >= ##StartRow:INT?1##
AND         row    <= ##EndRow:INT?50000##
ORDER BY    row

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results