Oracle Query hierarchical relations with "connect by"

From WickyWiki
Revision as of 08:59, 11 January 2012 by Wilbert (talk | contribs) (Created page with "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 m...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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
  ;