title: How can I find the highest parent level or field in Oracle?
body: <p>I have a table called "test". It contains Parent and Child columns.</p>
  
  <pre><code>Parent  Child
    1      101
    1      102
    1      103
   101     121
   101     123
   103     133
   121     80
   121     81
  </code></pre>
  
  <p>Now, I wrote a query which brings me all the child/parents for the given "1" value.</p>
  
  <pre><code>( SELECT parent,child,LEVEL FROM TEST
      START WITH child= 1
      CONNECT BY PRIOR parent=child) 
  UNION ALL
     (SELECT parent,child,LEVEL FROM TEST
        START WITH parent=1
        CONNECT BY PRIOR child=parent)
        ORDER BY parent
  </code></pre>
  
  <p>But I want all the child/parent in that hierarchy irrespective of any value given ..i.e. if I give "80"  ...., I have to fetch HIGHEST PARENT VALUE( in this case "1") and then search all the children of that highest parent value below. </p>