How to LOAD DATA INFILE in mysql with first col being Auto Increment?

后端 未结 7 2002
离开以前
离开以前 2020-11-30 02:05

Currently, We have a table similar to this:

---------------------
ID | AField | BField|
---------------------

The ID is Auto Increment

相关标签:
7条回答
  • 2020-11-30 03:12

    you can "omit" ID field in data row by placing delimiter sign in the beginning of a row, like this (for table schema ID,AField,BField):

    ,afieldvalue,bfieldvalue
    ...
    

    SQL engine will assign NULL to ID field while reading such csv file

    0 讨论(0)
提交回复
热议问题