我想把文件:aaa.txt如下
aaa|bbb|ccc|bbb
qqq|aaa|ddd|fff
导入数据库中的T表中的a,b,c,b四个字段中,结果不行,这个应该怎么写?T中有多余4个字段。
load data infile 'd:\\aaa.txt' replace into table T(a,b,c,d) fields terminated by '|';
ERROR 1064 (42000): 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 'field
s terminated by '|'' at line 1
aaa|bbb|ccc|bbb
qqq|aaa|ddd|fff
导入数据库中的T表中的a,b,c,b四个字段中,结果不行,这个应该怎么写?T中有多余4个字段。
load data infile 'd:\\aaa.txt' replace into table T(a,b,c,d) fields terminated by '|';
ERROR 1064 (42000): 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 'field
s terminated by '|'' at line 1
[REPLACE | IGNORE]
INTO TABLE tbl_name
[CHARACTER SET charset_name]
[{FIELDS | COLUMNS}
[TERMINATED BY 'string']
[[OPTIONALLY] ENCLOSED BY 'char']
[ESCAPED BY 'char']
]
[LINES
[STARTING BY 'string']
[TERMINATED BY 'string']
]
[IGNORE number LINES]
[(col_name_or_user_var,...)]
[SET col_name = expr,...]