Issues with importing tables
sql = INSERT INTO dx_gd_goods select * from Dx_gd_goods2
The above name is the DX_GD_GOODS2 data into the dx_gd_goods, of course, including the DX_GD_GOODS2 in the primary key ID
I don't want to import the primary key ID into it because it may cause the primary key to repeat and the import fails. What I want is a successful import, and the primary key is never possible to repeat,
I've tried this before.
Insert INTO Dx_gd_goods Select (a,b,c,d) from Dx_gd_goods2
Read only the dx_gd_goods2 corresponding fields, and then import into Dx_gd_goods, but failed.
------Solution--------------------
Insert INTO Dx_gd_goods (A,b,c ...) select (a,b,c,d) from DX_GD_GOODS2//Specify field Import
------Solution--------------------
SQL code
insert into B (b1,b2 ...) (select A1,a2 ... from A)
------Solution--------------------
failed? Then you put the wrong information to see.
------Solution--------------------
to post your error message, so it's good to analyze the problem
------Solution--------------------
You should post the specific table results.
actually 0 fields involving IDs are represented by NULL, for example a field is ID, then
INSERT into Dx_gd_goods select ' null ', b,c,d from Dx_gd_goods2
------Solution--------------------
You should post the results of the specific table
actually 0 fields involving IDs are represented by NULL, such as the A field is ID, then it should be
insert INTO DX _gd_goods select ' null ', b,c,d from DX_GD_GOODS2
------Solution--------------------
You should post specific table results
In fact, 0 refers to the ID of the field is indicated by null, such as the A field is the ID, then should be
INSERT into dx_gd_goods select ' null ', b,c,d from Dx_gd_goods2