【发布时间】:2014-04-16 08:58:22
【问题描述】:
我正在尝试在表格中插入一些数据,但由于某些原因,只导入了我的 csv 文件的第一行。
命令:
load data local infile 'D:/BPMAND.csv' into table `bpmand_update`
fields terminated by ',' optionally enclosed by '"' lines terminated by '\r\n'
( @skip, `customers_id`, @skip, @skip, @skip, `date_altered`, @skip);
我的 csv 文件:
24108,"2013-11-13 11:00:00"
10865,"2014-01-09 11:00:00"
...
表结构:
+----------------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+-------------+------+-----+---------+-------+
| orders_id | int(11) | YES | | NULL | |
| customers_id | varchar(20) | YES | | NULL | |
| bonuspoints_received | int(11) | YES | | NULL | |
| bonuspoints_spent | int(11) | YES | | NULL | |
| current_bonuspoints | int(11) | YES | | NULL | |
| date_altered | datetime | YES | | NULL | |
| comment | varchar(50) | YES | | NULL | |
+----------------------+-------------+------+-----+---------+-------+
我也尝试不使用@skip,但得到了相同的结果。有什么想法吗?
【问题讨论】: