例:
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 |
相关文章
暂无评论...
