0

I am currently importing a large data set from a CSV file and I keep getting the error duplicate primary key. The issue is I cannot add a new column to the csv for an autoincrement column in the database.

Is there a way while importing to make it skip a field via the query?

I.e I have 2 columns in the CSV and 3 in the database where the 3rd is the primary key

1 Answer 1

1

Give a list of fields present in the file.

LOAD DATA INFILE 'file.csv' INTO TABLE tablename(col2,col3);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.