标签:
(NO.1)
LOAD DATA INFILE ‘file.csv‘ INTO TABLE dados_meteo
(@var1, @var2)
SET column1 = REPLACE(@var1, ‘,‘, ‘.‘), column2 = REPLACE(@var2, ‘,‘, ‘.‘)
(no.2)
LOAD DATA infile ‘/usr/local/src/cre_tab/report02.csv‘
REPLACE INTO TABLE `table_metadata_info` character set gbk FIELDS TERMINATED BY ‘,‘ ENCLOSED BY ‘"‘ ESCAPED BY ‘\\‘ LINES TERMINATED BY ‘\r\n‘
IGNORE 1 LINES (@var1,@var2,@var3,@var4,@var5,@var6,@var7,@var8)
set table_name=rtrim(ltrim(@var1)),column_name_comment=rtrim(ltrim(@var4)),column_name=rtrim(ltrim(@var3)),
column_type=rtrim(ltrim(@var5)), constraints=rtrim(ltrim(@var6)),default_value=rtrim(ltrim(@var7));
标签:
原文地址:http://www.cnblogs.com/janehoo/p/5583364.html