1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| With MaTable as
(
select 0 as id, 'vehicule' as libelle, null as idpere from dual union all
select 1 , 'auto' , 0 from dual union all
select 2 , 'moto' , 0 from dual union all
select 3 , 'citadine' , 1 from dual union all
select 4 , '4x4' , 1 from dual union all
select 5 , 'berline' , 1 from dual union all
select 6 , '125' , 2 from dual union all
select 7 , '250' , 2 from dual union all
select 8 , '500' , 2 from dual union all
select 9 , 'GS500' , 8 from dual union all
select 10 , 'c1' , 3 from dual
)
select id, libelle
from MaTable
where level > 1
start with id = 3
connect by idpere = prior id
order by id asc;
ID LIBELLE
---------- --------
10 c1 |
Partager