17,377
社区成员
发帖
与我相关
我的任务
分享
select *
from (select level as mat_level,
t.组件,
connect_by_root t.物料,
connect_by_isleaf
from table t
start with 物料 = 882
connect by T.物料 = prior T.组件)
where connect_by_isleaf = 1
select *
from (select level as mat_level,
t.组件,
connect_by_root t.物料,
connect_by_isleaf,
max(level) over() mlv
from table t
start with 物料 = 882
connect by T.物料 = prior T.组件)
where connect_by_isleaf = 1
and mlv = mat_level