I've got a MySQL table Researcher :
ID | FirstName | Surname | Email | Position | Summary | ... + many more columns.
And a CSV file with the columns:
Email | Summary
In the MySQL table, the Summary column is blank for all rows, the data currently exists in the CSV.
I would like to import the Summary column from the CSV file, into the MySQL table, using Email to match the rows.
How can I achieve this?
解决方案
Thanks for pointing me in the right direction fancyPants.
I eventually solved it like this:
Created a new table in the DB called Researcher_Temp with columns from the CSV.
Used phpMyAdmin to import the CSV using LOAD DATA into Researcher_Temp
Ran the following query to add the summary data from Researcher_Temp into my main Researcher table:
UPDATE Researcher
INNER JOIN Researcher_Temp on Researcher_Temp.Email = Researcher.Email
SET Researcher.Summary = Researcher_Temp.Summary;
I then deleted the Temp table.