title: Oracle hierarchy query to find parents and child values From a table
body: <p>I have a source table which contains values as :</p>
  
  <pre><code>   Col1          Col2
      A             B
      B             C
      E             F
      F             G
      G             H
      X             Y 
  </code></pre>
  
  <p>In this scenario A is a parent and b is child of A 
  And C is a grand child of A, parent and it's child with grand child's should come in one single line. 
  So the expected output is </p>
  
  <p>Output :</p>
  
  <pre><code>A  B  C 
  E  F  G  H
  X  Y 
  </code></pre>