【Vegas原创】对应父节点的树状返回查询
例:
将此改为树状返回值:
select rtstpre,rtstname
from proute
where rtid='ROU00371'
from proute
where rtid='ROU00371'
RTSTPRE | RTSTNAME |
PE | Packing |
START | FI |
FI | Glue |
Glue | PE |
将此改为树状返回值:
select sys_connect_by_path(rtstname,'-') path
from (
select rtstpre,rtstname
from proute
where rtid='ROU00371'
)
start with rtstpre='START'
connect by prior rtstname=rtstpre
from (
select rtstpre,rtstname
from proute
where rtid='ROU00371'
)
start with rtstpre='START'
connect by prior rtstname=rtstpre
PATH |
-FI |
-FI-Glue |
-FI-Glue-PE |
-FI-Glue-PE-Packing |
喜欢请赞赏一下啦^_^