I'm trying to update one field using a CSV file with two fields, the primary key field and another varchar field. There are more than two fields in the table, but I'm trying to only update one using the key as a reference. Here's the command I'm using:
LOAD DATA LOCAL INFILE '$filename' REPLACE INTO TABLE sponsors FIELDS
TERMINATED BY ',' LINES TERMINATED BY '\n' (sponsor_number, email)
The problem is it updates, but deletes all other data in the table besides what I insert. Is there an easy way to do what I am trying to accomplish without running 3,000 UPDATE commands?
Thanks in advance!!! 🙂
Tom