I have a tab separated text file in the format
id | field 1 | field 2 ...
I want to insert this into a mysql database with id as the primary key but the text file may contain duplicate id's .
- How to make sure that there's just one entry corresponding to each id.
- How to make a choice between two lines having the same id (Yes, they might not be consistent, but it's okay to choose one over other like the first or the last occurrence )