select * from CITYMANAGE start with id='190' connect by prior id=parentid ; 查询自己和自己的下级
select * from CITYMANAGE start with parentid ='190' connect by prior id=parentid ; 查询自己的下级
select * from CITYMANAGE start with id='190' connect by id=prior parentid ; 查询自己和自己的上级
select * from CITYMANAGE start with id='190' connect by id=prior parentid ; 查询自己和自己的上级
分行显示查询结果
SYS_CONNECT_BY_PATH(列名,'>') 将结果按自定义符号拼接起来
select SYS_CONNECT_BY_PATH(id,'>') from CITYMANAGE start with id='190' connect by prior id=parentid ; 查询自己和自己的下级