我学MySQL导入导出的时候,在菜鸟教程俩例子:
第一个:
SELECT * FROM c200401 INTO OUTFILE 'D:/csv.txt'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';
第二个:
SELECT * FROM c200401 INTO OUTFILE 'D:/result2.txt'
FIELDS TERMINATED BY ','
OPTIONALLY
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n';
第二个比第一个多了个 OPTIONALLY ,我试了试, 第一组数据少了个一对"",
我想问问,OPTIONALLY有什么讲究?
[OPTIONALLY] ENCLOSED indicates what characters are used to include the field. If OPTIONALLY is used, only CHAR and VERCHAR are included. ESCAPED indicates what characters are used as escape characters when escaping is required. LINES TERMINATED indicates what characters are used to separate each row of records.