根据父ID查询所有的子数据(向下递归) SELECT * FROM TEST START WITH PARENT_ID = '0' CONNECT BY PRIOR ID = PARENT_ID;
SELECT * FROM TEST START WITH PARENT_ID = '0' CONNECT BY PRIOR ID = PARENT_ID;
根1据ID查询所有的父级(像上递归) SELECT * FROM TEST START WITH ID = '123' CONNECT BY ID = PRIOR PAERENT_ID;
SELECT * FROM TEST START WITH ID = '123' CONNECT BY ID = PRIOR PAERENT_ID;