title: Finding last child in a hierarchy in oracle
body: <p>I have a table like</p>
  
  <pre><code>prnt_id   child_id
  -----------------
  1           2
  2           4
  3
  5
  6           7
  7           8
  8           9
  </code></pre>
  
  <p>My result should contain</p>
  
  <pre><code>prnt_id  child_id
  -----------------
  1          4
  3
  5
  6          9
  </code></pre>
  
  <p>I am using oracle 10g.</p>
  
  <p>I tried doing it with connect by but did not get expected result. </p>