Issues related to importing tables

Source: Internet
Author: User
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
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.