SELECT LEVEL
,CONNECT_BY_ISLEAF IS_LEAF --> 이게 DB2에서 지원 안함
,EX.*
FROM (
SELECT C.PAR_MENU_ACT_ID
,B.MENU_ACT_ID
,A.DISPLAY_NM
,B.ACTIVE_MENU_IMAGE
,B.INACTIVE_MENU_IMAGE
,C.DISPLAY_ORDER
,(
SELECT E.WINDOW_ACT_ID FROM
( SELECT MENU_ACT_ID
, WINDOW_ACT_ID
FROM C_MENU_WINDOW_MAP
ORDER BY WINDOW_DEFAULT_YN DESC
, WINDOW_ACT_ID ASC
) E
WHERE ROWNUM = 1
AND E.MENU_ACT_ID = B.MENU_ACT_ID
) AS WINDOW_ACT_ID
FROM
C_GROUP_ROLE_MENU_ACT_AUTH D
,C_PKG_MENU_MAP C
,C_MENU_ACT B
,C_MENU_DISPLAY A
WHERE A.LANG_CD = 'ko-KR'
AND A.MENU_ACT_ID = B.MENU_ACT_ID
AND B.MENU_ACT_ID = C.MENU_ACT_ID
AND B.MENU_DISPLAY_YN = 'Y'
AND C.PKG_ID = D.PKG_ID
AND C.MENU_ACT_ID <> C.PAR_MENU_ACT_ID
AND D.PKG_ID = 6
AND D.PAR_MENU_ACT_ID = C.PAR_MENU_ACT_ID
AND D.MENU_ACT_ID = C.MENU_ACT_ID
AND D.GROUP_ID = 5
AND D.ROLE_ID = 7
AND D.ACCESS_YN = 'Y'
ORDER BY C.DISPLAY_ORDER
) EX
START WITH EX.PAR_MENU_ACT_ID='AML'
CONNECT BY PRIOR EX.MENU_ACT_ID=EX.PAR_MENU_ACT_ID;
CONNECT_BY_ISLEAF IS_LEAF 로인해 DB2에서 오류가나는데요 WITH문을 사용해서 계층 쿼리를 만들어야하는데 어떻게해야하는지 너무 모르겠습니다..
꼭 도와주시면 감사하겠습니다
|