oracle 递归
发布网友
发布时间:2022-05-13 01:22
我来回答
共1个回答
热心网友
时间:2023-11-09 20:21
可以的。。。测试如下:
create table t1(id_c number,id_p number, value varchar2(10));
insert into t1 values(10,null, 'j');
insert into t1 values(20,10, 'i');
insert into t1 values(21,10 ,'l');
insert into t1 values(30,20 ,'h');
insert into t1 values(31,21 ,'k');
insert into t1 values(32,21 ,'m');
commit;
select * from t1;
select * from t1 start with id_c in(10,20)
connect by prior id_c=id_p
结果:
12010i
23020h
310j
42010i
53020h
62110l
73121k
83221m