Question : Oracle - Connect by Prior - Two times in single query

Hi!

I am working on Oracle. I have two tables with recursive relationships. I have to derive a Hierarchial View from both these tables in a single view.

For this, i need to use CONNECT BY PRIOR statement twice. How is this achievable?

Thanks in advance.

Answer : Oracle - Connect by Prior - Two times in single query

there was an error in the code when we have multiple records in region table for each type

try this


select region_id,type_id,ltrim(sys_connect_by_path( TYPE_NAME, ',' ),',') region_type,ltrim(sys_connect_by_path(REGION_NAME , ',' ),',') from region_type a, regions b where a.type_id=b.region_type_id
start with REGION_PARENT_ID is null
connect by prior REGION_ID = REGION_PARENT_ID;  

Random Solutions  
 
programming4us programming4us