日期:2014-05-17 浏览次数:20987 次
select wm_concat( child_ID ) from t_belong t start with t.father_id=1002 connect by prior t.child_id=t.father_id
------解决方案--------------------
create table t_belong( id number(18,0), father_id number(18,0), child_id number(18,0) ); insert into t_belong(id,father_id,child_id) values(1, 1002, 1003); insert into t_belong(id,father_id,child_id) values(2, 1002, 1004); insert into t_belong(id,father_id,child_id) values(3, 1003, 1005); insert into t_belong(id,father_id,child_id) values(4, 1004, 1006); insert into t_belong(id,father_id,child_id) values(5, 1004, 1007);