title: Genealogy Query in Oracle
body: <p>I'm trying to fetch a genealogy tree of animals from my Oracle database.</p>
  
  <p>Here's the table:</p>
  
  <pre><code>Animal
  ------------------------
  Animal_ID
  Parent_Male_ID
  Parent_Female_ID
  ....
  ....
  ------------------------
  </code></pre>
  
  <p>If I specify an animal, I can get all of its descendants (on the male side) using something like this:</p>
  
  <pre><code>SELECT *
  FROM animal
  START WITH animal_id = 123
  CONNECT BY PRIOR animal_id = parent_male_id
  </code></pre>
  
  <p>I'm trying to find a way to extend this in such a way that if I specify an animal, it will fetch both parents and then will fetch all of their descendants.</p>
  
  <p>Any thoughts? (this is Oracle 9.2)</p>