适配问题

如果是固定列加上下面的判断
load data LOCAL infile ‘example_data1.txt’
into table ttt
FIELDS TERMINATED BY ‘;’
OPTIONALLY ENCLOSED BY ‘’
LINES TERMINATED BY ‘\ ’
(@col1,col2,@col3,col4)
set col1=if(@col1=’’,11,@col1),col3=if(@col3=’’,null,@col3);

2 个赞