MySQL批量更新數據的方法可以使用以下三種方式:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
INSERT INTO table_name (column1, column2, ...)
VALUES (value1, value2, ...)
ON DUPLICATE KEY UPDATE
column1 = value1, column2 = value2, ...;
LOAD DATA INFILE '/path/to/file.csv'
INTO TABLE table_name
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(column1, column2, ...);
以上是常用的批量更新數據的方法,具體使用哪種方法取決于數據量和需求。