我的.csv文件有几列。我只想导入3列,如下所示。但是,代码的LOAD DATA部分无效。有人可以帮助您确定错误的位置吗?
我收到的错误是 第1行被截断-它包含的数据多于输入列
DROP TABLE IF EXISTS book;
CREATE TABLE book (
`Event` LONGTEXT,
`Event Description` LONGTEXT,
`Validated` LONGTEXT
);
set @`Event` = 'Event';
set @`Event Description` = 'Event Description';
set @`Validated` = 'Validated';
LOAD DATA LOCAL INFILE 'C:/Users/BPerei23/Desktop/test.csv' REPLACE INTO TABLE book
CHARACTER SET Latin1 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES
(@`Event` ,
@`Event Description`,
@`Validated` );
DESCRIBE book;
SELECT * from book;