title: Insert row with another column containing the row's id, besides the id column
body: <p>Here is a minimal version of my table:</p>
  
  <pre><code>CREATE TABLE posts (
      id int unsigned PRIMARY KEY auto_increment,
      root_id int unsigned,
      parent_id int unsigned
  );
  </code></pre>
  
  <p>The data is in a tree structure, so the <code>parent_id</code> field contains the obvious, and the <code>root_id</code> field contains the id of the root post, that is, the topmost post in the tree, the oldest ancestor in the tree.</p>
  
  <p>Now, when I insert a new post that is itself the root of a new tree, the <code>parent_id</code> will be null, for it has no parent, but the <code>root_id</code> should refer to itself. Is there a way to do an insert that will put the same value of <code>id</code> into <code>root_id</code>? I'd like to avoid doing the insert, getting the new id and changing the root id with a second query, but maybe that's the only way.</p>
  
  <p>Thanks in advance.</p>