tags:

views:

22

answers:

1

The new table has an auto-increment that I want to use for the data that I'm transferring.

Here is the query I want to run.

INSERT INTO `xyz_1mydata` SELECT * FROM `xyz_1production`  WHERE `xyz_1production.Id`  > '12000';

I don't want to replace the existing items in #_1mydata.

+2  A: 

List all the fields you want to transfer in your query. In this case, every field except the Id field. That way the rows inserted into xyz_1mydata will get newly generated IDs.

INSERT INTO xyz_1mydata (field1, field2, ...)
    SELECT field1, field2, ... FROM xyz_1production...
Matti Virkkunen
Thanks Matti, sounds very straightforward.
ggg