title: insert record from another table with auto increment column new table
body: <p>I have to insert record from a table with <code>auto_increment</code> id field.</p>
  
  <pre><code>CREATE TEMPORARY TABLE tmptable SELECT * 
  FROM  `wp_rg_lead_detail` 
  WHERE lead_id =59;
  UPDATE tmptable SET lead_id =60 WHERE lead_id =59;
  insert into `wp_rg_lead_detail` (`id`, `lead_id`, `form_id`, `field_number`, `value`)
      select `id`, `lead_id`, `form_id`, `field_number`, `value`
      from `tmptable`
      WHERE lead_id =60;
  </code></pre>
  
  <blockquote>
    <p>Duplicate entry '1' for key 'PRIMARY' </p>
  </blockquote>
  
  <p>I need auto_increment filed <code>id</code> in target table should increment by above query.</p>