您可以用来
LOAD DATA INFILE将800,000行数据批量加载到临时表中,然后使用多表
UPDATE语法将现有表连接到临时表并更新数量值。
例如:
CREATE TEMPORARY TABLE your_temp_table LIKE your_table;LOAD DATA INFILE '/tmp/your_file.csv'INTO TABLE your_temp_tableFIELDS TERMINATED BY ','(id, product, sku, department, quantity);UPDATE your_tableINNER JOIN your_temp_table on your_temp_table.id = your_table.idSET your_table.quantity = your_temp_table.quantity;DROP TEMPORARY TABLE your_temp_table;



