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;
returns
/Doctrine
/Doctrine/Air
/Doctrine/Air/Jet powered aircraft
/Doctrine/Air/Jet powered aircraft/F-16
All i want is just /Doctrine/Air/Jet powered aircraft/F-16
without the other three results. Is there a way for that?
Edit:
My oracle version:
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: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production