title: get all parent records from child record
body: <p>I have an oracle table similar to this</p>
  
  <p>TableName:Note</p>
  
  <pre><code>NoteID(PK)        NoteText    ParentNoteID
  1                 x           - 
  2                 y           1
  3                 z           2
  </code></pre>
  
  <p>Here I need to perform an like query on top of notetext say,
  note.note_text like '%z%'which pulls out an third record alone.</p>
  
  <p>I wish to pull the records of it's parent's as well.i.e after getting the third record,which matches through like query i need to travel back by seeing 
  parentNoteID .So parent note of 3 rd record is 2 and parent record of 2 is 1.so the result should fetch
  all the three record.</p>
  
  <p>To extend this,if my like query matches two child records,apparently it should get all parents records of both.</p>
  
  <p>Example:</p>
  
  <pre><code>NoteID(PK)  NoteText    ParentNoteID
  1           x           -  
  2           y           1
  3           z           2
  4           a           -
  5           b           4
  6           z           5
  </code></pre>
  
  <p><code>note.note_text like '%z%'</code> should pull,all the above 6 records.</p>
  
  <p>Thanks in advance
  Eswar.</p>