반응형
DECLARE @V_CURRENTPAGEINDEX INT, @V_PAGESIZE INT;
SET @V_CURRENTPAGEINDEX = 0; --PAGE1=0, PAGE2=1,...
SET @V_PAGESIZE = 10; --ROWCOUNT
SELECT TOP (@V_PAGESIZE) *
FROM #TEMP
WHERE ID NOT IN (SELECT TOP (@V_CURRENTPAGEINDEX * @V_PAGESIZE) ID FROM #TEMP)
ORDER BY ID DESC;
반응형