title: MySQL all parent-child relationships
body: <p>I have a table named <code>table</code>. It has a field named <code>id</code> with type <code>INT(11)</code> that stands for an identifier of the row, it has other fields but I don't think they are relevant for this problem.</p>
  
  <p>I have another table named <code>table_children</code>. It has a field named <code>parent</code> with type <code>INT(11)</code> that refers to <code>table.id</code> as a foreign key. It has another field named <code>child</code>  with type <code>INT(11)</code> that also refers to <code>table.id</code> as a foreign key. This table describes <code>table</code> row to <code>table</code> row parent-child relationships.</p>
  
  <p>Here is a probable setting.</p>
  
  <pre><code>table   table_children
  id      parent child
  0       0      1
  1       1      2
  2       1      3
  3       3      4
  4
  </code></pre>
  
  <p>How can I get the <code>id</code>'s of all the descendents of <code>0</code> in a minimum number of requests? The answer here would be <code>1</code>, <code>2</code>, <code>3</code>, <code>4</code>.</p>
  
  <p>Thank you for your help.</p>