title: What is the best way to fetch Tree/Hierarchical structure data from Oracle
body: <p>I want to fetch Hierarchical/Tree data something like below from a Table which has following definiton.</p>
  
  <pre><code>Tree Table:
  """""""""""
  Id   |ParentId
  """""""""""
  Work1|null
  Work2|Work1
  Work3|Work2
  ...
  </code></pre>
  
  <p>Required Query result Data (no need to be tabbed)- If I Pick 'Work1' I should complete Ids which are under its root something like below. If I pick 'Work2' then also I should complete Ids above and below its root.</p>
  
  <pre><code>&gt; Work1 
  ----------
  &gt;   Work2
  ----------
  &gt;     Work3
  ---------
  </code></pre>
  
  <p>I used below query but it is giving me duplicate records.</p>
  
  <pre><code>select Id from TreeTable start with Id in ('Work1','Work2') connect by nocycle Parentid=prior Id or Id = prior Parentid
  </code></pre>
  
  <p><em>Note: I want to get the data within a <strong>SINGLE QUERY</strong> (optimized) way</em></p>
  
  <p>Thanks and Regards,
  PV.</p>