Time:09-22
CodePudding user response:
CONNECT_BY_ROOT
select * The from (select level as mat_level, T. components, Connect_by_root t. material, Connect_by_isleaf From the table t Start with the material=882 Connect by material=the prior t. t. components) Where connect_by_isleaf=1
select * The from (select level as mat_level, T. components, Connect_by_root t. material, Connect_by_isleaf, Max (level) over (MLV) From the table t Start with the material=882 Connect by material=the prior t. t. components) Where connect_by_isleaf=1 And MLV=mat_level
Page link:https//www.codepudding.com/database/20487.html