I need to update existing rows in table with load data infile based on some condition, is this possible?
load data infile 'E:/xxx.csv' into table tld_tod @aaa, @xxx_date, @ccc fields terminated by ',' LINES TERMINATED BY '\r\n' set xxx = str_to_date(@xxx_date, '%d-%b-%y') where xxx is not null and aaa=@aaa
Best Answer
You ca also create a staging table, insert the data from the CSV file into the staging table and then finally insert the data into your target table with the required operations and filtering.