Computer(IT)/Oracle

하위데위터 트리형태 조회

약탄치킨 2013. 1. 28. 10:02
반응형

코드 또는 데이터 하위 단계 트리형태 조회

 

select t1.cod_id, t1.cod_name, t1.cod_pid, decode(cod_used, '1', 'O', 'X') used,  level lev
from ecf_code t1
where cod_cty_id ='ICMCONTENT'
start with cod_pid is null
connect by prior t1.cod_id = t1.cod_pid
order siblings by  cod_order, cod_id