title: select categories with parent name from one table
body: <p>I got an existing products database which I'm writing an administration tool for (in PHP).
  The database contains the following "categories" table:</p>
  
  <pre><code>Table Categories
  --------------------
  PK | id
  FK | parent_id
     | title
  </code></pre>
  
  <p>Now the foreign key "parent_id" contains an id taken from the same table, or "0" if it's a topmost category.</p>
  
  <p>For creating an overview I now need a mysql statement which results in the following data:</p>
  
  <pre><code>id | parent_id | title | parent_title
  </code></pre>
  
  <p>The parent_title is where I've no idea. I created the following statement:</p>
  
  <pre><code>SELECT 
    c1.id, 
    c1.parent_id, 
    c1.title, 
    c2.title as `parent_title`
  FROM 
    categories c1, 
    categories c2 
  WHERE 
    c1.parent_id = c2.id
  </code></pre>
  
  <p>I now only get all categories which have got a parent category.</p>
  
  <p>Should be simple, and might have already been answered here. I think I only didn't find the right words to search for to find it by searching existing articles.</p>
  
  <p>Thanks for your help,
  Daniel</p>