加载语句参数preserve blanks用于设定是否保留字段内容两端的空格,加载语句默认不保留空格。
加载语句示例:drop database if exists test;create database test;use test;create table t(a int, b varchar(20),c bigint); (1)加载默认不保留空格load data infile 'file://${ip_host}/opt/t.tbl' into table t fields terminated by '|';
(2)加载语句参数preserve blanks,保留字段两端空格load data infile 'file://${ip_host}/opt/t.tbl' into table t fields terminated by '|' preserve blanks;
(3)加载语句参数preserve leading blanks,保留字段左端空格load data infile 'file://${ip_host}/opt/t.tbl' into table t fields terminated by '|' preserve leading blanks;
(4)加载语句参数preserve trailing blanks,保留字段右端空格load data infile 'file://${ip_host}/opt/t.tbl' into table t fields terminated by '|' preserve trailing blanks;
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。