I'm using MySQL with 5.7.21-21 version, and I have a table shipping_rate with structure like this:
+---------+----+
|entity_id|rate|
+---------+----+
i want to update the record using csv file using MySQL command line, here's what my csv file look like:
i tried to follow this solution, and modify some code so it will fit my table:
CREATE TEMPORARY TABLE temp_update_table (entity_id,rate)
LOAD DATA INFILE 'sr.csv'
INTO TABLE temp_update_table FIELDS TERMINATED BY ',' (entity_id, rate);
UPDATE shipping_rate
INNER JOIN temp_update_table on temp_update_table.entity_id = shipping_rate.entity_id
SET shipping_rate.rate = temp_update_table.rate;
DROP TEMPORARY TABLE temp_update_table;
but i always got an error like this:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' rate)
