【Vegas原创】对应父节点的树状返回查询

例:
select rtstpre,rtstname
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

PATH
-FI
-FI-Glue
-FI-Glue-PE
-FI-Glue-PE-Packing


posted @ 2009-08-14 09:34  李济宏(Amadeus)  阅读(142)  评论(0编辑  收藏  举报