title: Convert the below logic in oracle tree
body: <p>Recursively the parent is inserted first and then the children. How can I migrate the logic in Oracle using parent-child.The logic for the SQL should be first the parent is evaluated and then inserted or added and then the child is checked and then it is prepared.</p>
  <p>Thank you for the response , the table structure as follow Name</p>
  <pre><code>REF_ID        NOT NULL NUMBER        
  REF_TYPE_ID   NOT NULL NUMBER        
  PARENT_REF_ID          NUMBER        
  REF_VALUE     NOT NULL VARCHAR2(255) 
  
                                                                                              
  </code></pre>
  <p>Now the expected result conditions:  we need to start finding the query with ref_id, so if ref_id is supposed 14, then we need to check the corresponding should have parent_ref_id is null or not, if parent_ref_id is present suppose 4, then we need to again get the value for 4 as ref_id and check is parent_id is null or not If null then we need to check the value ref_type_id whether it is 1, 2,3,4,..; etc and based on the condition we need to append the result 4(parent_ref_id) with some text let it be 'article 4'. Now resuming back to the loop, the user had enter ref_id 14, then we need to check the value for ref_type_id for the corresponding and then we need to append with the result suppose 'par 14' and this result had to come after parent result: <strong>article 4 par 14</strong> (article 4 - parent, par 14 children)</p>