3
如何在數字使用逗號作爲小數點分隔符時導入TSV文件?MySQL LOAD DATA INFILE用逗號作爲小數點分隔符
LOAD DATA INFILE '$filename' INTO TABLE dados_meteo IGNORE 3 LINES
($fields[0], $fields[1], $fields[2], $fields[3], $fields[4], $fields[5])
SET POM='$pom'
;
謝謝@Andrew我嘗試後最終代碼 - 是給我一個語法錯誤 – Hugo 2012-01-04 23:52:16
'LOAD DATA INFILE '$文件名' INTO TABLE dados_meteo忽略三行 (@ SET POM ='$ pom', $ field [0] = CONVERT(REPLACE(@ var1,',',''),DECIMAL(varl,@ var2,@ var3,@ var4,@ var5,@ var6) 10)), $ field [1] = CONVERT(REPLACE(@ var2,',',''),DECIMAL(10)), $ field [2] = CONVERT(REPLACE(@ var3,',', '),DECIMAL(10)), $ field [3] = CONVERT(REPLACE(@ var4,',',''),DECIMAL(10)), $ field [4] = CONVERT(REPLACE(@ var5,',','),DECIMAL(10)), $ field [5] = CONVERT(REPLACE(@ var6,',',''), DECIMAL(10)) ;' – Hugo 2012-01-04 23:58:53
你是通過PHP運行的嗎?你到底在哪裏發生了什麼錯誤? – Andrew 2012-01-05 00:16:52