title: SQL Hierarchy over multiple tables and result in multiple lines (not JOINING)
body: <p>I need help to query a Oracle DB, where data is contained in different tables. I have simplified it as follows:</p>
  <pre><code>Table Catalog, fields: ID, Code, Label
  Table Catalogstructure, fields: ID, Code, Label, CatalogID
  Table Catalogsegment, fields: ID, Code, Label, CatalogID, ParentID, StructureID
  </code></pre>
  <p>One Catalog has one structure, and a structure has many segments. ParentID in Catalogsegment contains the ID from the Catalogsegment, that is above of the selected one. The highest Catalogsegments don't have any ParentID.</p>
  <p>The result I want is on different lines, first the Catalog with ID, Code and Label, then the structure with ID, Code and Label and finally, from top to down, all the Catalogsegments with ID, Code and Label.</p>
  <p>Sample Data:</p>
  <pre><code>Catalog:
  1000, C1, Catalog 1
  2000, C2, Catalog 2
  
  CatalogStructure:
  1100, CS1, Structure 1, 1000
  1200, CS2, Strcuture 2, 1000
  2100, CS3, Structure 3, 2000
  
  CatalogSegment:
  1101, CSS1, Segment 1, 1000, null, 1100
  1102, CSS2, Segment 2, 1000, 1101, 1100
  1103, CSS3, Segment 3, 1000, 1102, 1100
  1104, CSS4, Segment 4, 1000, 1003, 1100
  1201, CSS5, Segment 5, 1000, null, 1200
  1202, CSS6, Segment 6, 1000, 1201, 1200
  2101, CSS7, Segment 7, 2000, null, 2100
  2102, CSS8, Segment 8, 2000, 2101, 2100
  </code></pre>
  <p>Result:</p>
  <pre><code>1000, C1, Catalog 1
  1100, CS1, Structure 1
  1101, CSS1, Segment 1
  1102, CSS2, Segment 2
  1103, CSS3, Segment 3
  1104, CSS4, Segment 4
  1200, CS2, Structure 2
  1201, CSS5, Segment 5
  1202, CSS6, Segment 6
  2000, C2, Catalog 2
  2100, CS3, Structure 3
  2101, CSS7, Segment 7
  2102, CSS8, Segment 8 
  </code></pre>