oracle优先深度查询


--查询3204菜单下面所有的子菜单以及子菜单下面包含的子菜单
--delete from tbMenu where menuId in
(select menuId from tbmenu start with menuId = 3204 connect by prior menuId = menuParentId);
--commit;

--查询32040101菜单上面所有的父菜单以及父菜单上面的父菜单
select menuId from tbmenu start with menuId = 32040101 connect by prior menuParentId=menuId 

你可能感兴趣的:(oracle)