Oracle Query hierarchical relations with "connect by"
From WickyWiki
Table HIERACHY has a master and a child key and an ROOT indication (indexed) the following query will show all possible paths using master-child relations, starting in records marked with ROOT=1
select SYS_CONNECT_BY_PATH(MASTER, '/') from HIERACHY connect by prior CHILD = MASTER start with ROOT=1 ;