title: Selecting all descendant rows from an Oracle table representing a tree structure
body: <p>I have a table MYTYPE in Oracle 10g representing a tree structure, which is something like this:</p>
  
  <pre><code>ID | PARENTID | DETAIL
  </code></pre>
  
  <p>I would like to select all rows in MYTYPE which are descendants of a particular ID, such that I can create queries elsewhere such as:</p>
  
  <pre><code>SELECT * 
    FROM MYDETAIL 
   WHERE MYTYPEID IN [all MYTYPE which are descendants of some ID];
  </code></pre>
  
  <p>What is a cost-efficient way of building the descendant set, preferably without using PL/SQL?</p>