create table t (id integer,parent_id integer)
insert into t values(1,0)
insert into t values(2,1)
insert into t values(3,1)
insert into t values(4,3)select * from t start with parent_id=0 connect by prior id = parent_id
ID PARENT_ID
1 1 0
2 2 1
3 3 1
4 4 3
insert into t values(1,0)
insert into t values(2,1)
insert into t values(3,1)
insert into t values(4,3)select * from t start with parent_id=0 connect by prior id = parent_id
ID PARENT_ID
1 1 0
2 2 1
3 3 1
4 4 3
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货