[ORACLE] 오라클 페이징 3가지 쿼리, PAGING, RNUM, ROWNUM
오라클에서 페이징 구현할때 쓰는 쿼리입니다.
SELECT * FROM (
SELECT ROWNUM AS RNUM, A.* FROM (
SELECT 컬럼 FROM 테이블
) A WHERE ROWNUM <= 시작점 + 출력양 ORDER BY ROWNUM DESC
) WHERE ROWNUM <= 출력양 ORDER BY RNUM ASC
SELECT ROWNUM AS RNUM, A.* FROM (
SELECT 컬럼 FROM 테이블
) A WHERE ROWNUM <= 시작점 + 출력양 ORDER BY ROWNUM DESC
) WHERE ROWNUM <= 출력양 ORDER BY RNUM ASC
SELECT * FROM (
SELECT ROWNUM AS RNUM, A.* FROM (
SELECT 컬럼 FROM 테이블
) A WHERE ROWNUM < 출력양
) WHERE RNUM > 시작점 ORDER BY 컬럼 DESC
SELECT ROWNUM AS RNUM, A.* FROM (
SELECT 컬럼 FROM 테이블
) A WHERE ROWNUM < 출력양
) WHERE RNUM > 시작점 ORDER BY 컬럼 DESC
SELECT * FROM (
SELECT ROWNUM AS RNUM, 컬럼 FROM 테이블
) WHERE RNUM BETWEEN 시작점 AND 출력양
ORDER BY 컬럼 DESC
SELECT ROWNUM AS RNUM, 컬럼 FROM 테이블
) WHERE RNUM BETWEEN 시작점 AND 출력양
ORDER BY 컬럼 DESC