공부자료/MySQL1 MySQL 계층형 재귀쿼리 - Recursive 사용 MySQL 재귀쿼리 WITH RECURSIVE CTE AS ( SELECT MENU_ID , MENU_NM , PARENT_ID FROM MDPJ_MENU WHERE MENU_ID = '1' UNION ALL SELECT A.MENU_ID , A.MENU_NM , A.PARENT_ID FROM MDPJ_MENU A INNER JOIN CTE B ON A.PARENT_ID = B.MENU_ID ) SELECT MENU_ID , MENU_NM , PARENT_ID FROM CTE Table MENU_IDint(11)NOPRIauto_incrementMENU_NMvarchar(50)YESMENU_LVLvarchar(50)YESPARENT_IDvarchar(50)YESORDER_BYvarchar(300)YESC.. 2018. 8. 13. 이전 1 다음