3

I have a mysql table to which i have imported a csv file and if i try to import another csv file to the same mysql table will it replace the previous data or gets appended????

5
  • It gets appended. it will not harm your existing records unless you have some sort of key defined in the table (like unique key... In that case you need to mention 'REPLACE' in your import query) Commented May 24, 2016 at 6:02
  • I'd say that depends on how you import that CSV data. Why don't you simply try it with a test table? Commented May 24, 2016 at 6:02
  • import is like insert its not affect your previous data .it just appending Commented May 24, 2016 at 6:06
  • I have made id of the table as a primary key and it is auto incremented and when i import csv file the id will be auto incremented right??? Commented May 24, 2016 at 6:07
  • yes , You are right. in your case data will be appended. It wont do any harm to existing data, plus your id will be auto_incremented, no need to mention it in the query Commented May 24, 2016 at 6:17

1 Answer 1

3

CSV imports get treated as an INSERT statement which means no UPDATE is performed.

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.