title: SQL SELECT INSERT INTO Generate Unique Id
body: <p>I'm attempting to select a table of data and insert this data into another file with similar column names (it's essentially duplicate data). Current syntax as follows:</p>
  
  <pre><code>INSERT INTO TABLE1 (id, id2, col1, col2)
  SELECT similiarId, similiarId2, similiarCol1, similiarCol2  
  FROM TABLE2
  </code></pre>
  
  <p>The problem I have is generating unique key fields (declared as integers) for the newly inserted records. I can't use table2's key's as table1 has existing data and will error on duplicate key values.</p>
  
  <p>I cannot change the table schema and these are custom id columns not generated automatically by the DB.</p>