계층형 쿼리
SELECT *
FROM ORCL_BRD_RPL
START WITH BRD_PNO = 0 -- 시작행
CONNECT BY PRIOR BRD_NO = BRD_PNO -- 연결
ORDER SIBLINGS BY BRD_NO DESC; -- 정렬순서
계층형 쿼리를 ROWNUM을 이용하여 순서로 접근해서 찾아오는 방법
SELECT *
FROM (SELECT ROWNUM AS RNUM, E.*
FROM ( SELECT *
FROM ORCL_BRD_RPL
START WITH BRD_PNO = 0 -- 시작행
CONNECT BY PRIOR BRD_NO = BRD_PNO -- 연결
ORDER SIBLINGS BY BRD_NO DESC) E)
WHERE RNUM BETWEEN 3 AND 6;