title: How to get the full Hierarchy with SQL CTE
body: <p>Hi I am trying to get the full hierarchy of my category. Here is my sample table</p>
  
  <pre><code>ID     PARENT_ID       NAME          DEPTH
  ------------------------------------------
  1      NULL            A             1
  2      NULL            B             1
  3      NULL            C             1
  4      1               D             2
  5      4               E             3
  </code></pre>
  
  <p>The cte output should be this</p>
  
  <pre><code>ID     PARENT_ID       NAME
  ---------------------------
  1      NULL            A             
  2      NULL            B             
  3      NULL            C             
  4      1               D             
  5      4               E             
  5      1               E  
  </code></pre>
  
  <p>As you can see id:5 is parent of 4 and 1. How do i query the whole tree        </p>