select ... from ... where ... start with ... connect by ... prior ...;
比如 有一张表 t 字段: parent child 两个字段的关系是父子关系 a b a c a e b b1 b b2 c c1 e e1 e e3 d d1指定parent=a,选出 a b a c a e b b1 b b2 c c1 e e1 e e3select parent,child from test start with parent='a' connect by prior child=parent
from ...
where ...
start with ...
connect by ... prior ...;
有一张表 t
字段:
parent
child
两个字段的关系是父子关系
a b
a c
a e
b b1
b b2
c c1
e e1
e e3
d d1指定parent=a,选出
a b
a c
a e
b b1
b b2
c c1
e e1
e e3select parent,child from test start with parent='a'
connect by prior child=parent
这样的方法cool