SELECT LPAD('*', 2*level-1)||SYS_CONNECT_BY_PATH(unit_data, '/') "battle_unit_id"
FROM battle_units
START WITH battle_unit_id= 600
CONNECT BY PRIOR parent_id = battle_unit_id;
返回
/Doctrine
/Doctrine/Air
/Doctrine/Air/Jet powered aircraft
/Doctrine/Air/Jet powered aircraft/F-16
我想要的只是/Doctrine/Air/Jet powered aircraft/F-16
没有其他三个结果。有办法吗?
编辑:
我的甲骨文版本:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux:版本 11.2.0.3.0 - Production
NLSRTL 版本 11.2.0.3.0 - 生产