title: How to find all IDs of children recursively?
body: <p>I would like to get all IDs from children in a tree with MySQL only.</p>
  
  <p>I have a table like this:</p>
  
  <pre><code>ID parent_id name
  1  0         cat1
  2  1         subcat1
  3  2         sub-subcat1
  4  2         sub-subcat2
  5  0         cat2
  </code></pre>
  
  <p>Now I'm trying to get all child IDs for cat1 (2,3,4) recursively. Is there any way how to achieve that?</p>