我在以下MySQL查询中获得#1064 - You have an error in your SQL syntax;
。
LOAD DATA LOCAL INFILE 'path-to-file.csv'
INTO TABLE ls_missing_products
FIELDS TERMINATED BY ','
ENCLOSED BY '\"'
LINES TERMINATED BY '\\r'
ROWS (ProductID, status)
SET status = 0;
以下是我收到的完整错误消息。
#1064 - 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 'ROWS (ProductID, status) SET status = 0' at line 1
答案 0 :(得分:1)
ROWS是LOAD DATA中IGNORE关键字的一部分,可以添加IGNORE或删除ROWS。 https://dev.mysql.com/doc/refman/5.7/en/load-data.html