1、语法:start with 子节点ID='...' connect by prior 子节点ID = 父节点ID
含义:查询结果我所有的后代节点(包括我)
例子:
select id,parent_id
from T_SM_MENU
start with id = 'dqs'
connect by prior id = parent_id
2、语法:start with 子节点ID='...' connect by 子节点ID = prior 父节点ID
含义:查询结果我所有的前代节点(包括我)
例子:
select id,parent_id
from T_SM_MENU
start with id = 'dqs'
connect by id =prior parent_id
3、语法:start with 父节点ID='...' connect by prior 子节点ID = 父节点ID
含义:查询结果我所有的后代节点(不包括我)
例子:
select id,parent_id
from T_SM_MENU
start with id = 'dsm'
connect by prior id = parent_id
4、语法:start with 父节点ID='...' connect by 子节点ID = prior 父节点ID
含义:
例子:
select id,parent_id
from T_SM_MENU
start with id = 'dsm'
connect by id =prior parent_id