Posted on 2008. 1. 28. 13:49
Filed Under 카테고리 없음
SELECT * FROM (
SELECT rownum as rnum, A.* from (
SELECT * FROM BOARD_TEST ORDER BY THREAD DESC
) A
ORDER BY rownum DESC
)
WHERE rnum
BETWEEN
(([ARTICLE_PER_PAGE]*([CURRENT_PAGE]-1))+1)
AND
([ARTICLE_PER_PAGE]*([CURRENT_PAGE]-1) + [ARTICLE_PER_PAGE])
ORDER BY rnum ASC;
SELECT rownum as rnum, A.* from (
SELECT * FROM BOARD_TEST ORDER BY THREAD DESC
) A
ORDER BY rownum DESC
)
WHERE rnum
BETWEEN
(([ARTICLE_PER_PAGE]*([CURRENT_PAGE]-1))+1)
AND
([ARTICLE_PER_PAGE]*([CURRENT_PAGE]-1) + [ARTICLE_PER_PAGE])
ORDER BY rnum ASC;