title: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2' for key 'PRIMARY'
body: <p>Salute! I use following raw sql statement in Symfony to insert large number of rows from existing table INTO other table with the same structure, what contains as well a large number of existing rows [because the used tables are dynamically created to runtime, there are NOT SYMFONY-ENTITY]:</p>
  
  <pre><code>$sql_insert = "INSERT INTO table1".$proid." SELECT * from ".$tablename." ON DUPLICATE KEY UPDATE table1".$proid.".id = table1".$proid.".id + 1";
  </code></pre>
  
  <p>and still getting the same error: </p>
  
  <blockquote>
    <p>SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2' for key 'PRIMARY'</p>
  </blockquote>
  
  <p>It doesn't work for every entry, just only for first inserted entry... Please help me to resolve this problem. How can i update the primary key?</p>