Oké, dit zal slechter presteren dan je van plan was, maar mijn punt is dat je paginering op deze manier zou kunnen proberen:
WITH CTE AS
(
... original SQL goes here ...
)
SELECT A.*
FROM CTE A
INNER JOIN (SELECT YourKey,
ROW_NUMBER() OVER (ORDER BY ...) rnum
FROM CTE) B
ON A.YourKey = B.YourKey
WHERE rnum BETWEEN 1 AND 10;