結構像這樣:
my_Code,my_A1,my_A2,...my_A400
沒有匯出匯入過的時候,是完全正常的,查詢的時候一點錯誤沒有的,
但通過into outfile匯出,
select * from stock_table_static
into outfile 'D:/SQL_0_0_0_0_0_0_0_0_0_/_new/out.txt' CHARACTER SET UTF8 (備注:沒效果,匯出的還是ansi格式)
fields terminated by '\t' OPTIONALLY ENCLOSED BY '"' lines terminated by '\n';
然后再打開txt文本,復制資料到excel表格,修改部分資料后,再匯出到txt文本2,
這些文本用utraledit打開時候有例外提示,打開里面有一些問號?,想要洗掉不可以的。


匯入是這個陳述句匯入的
SET NAMES GBK;
load data local infile 'D:/SQL_0_0_0_0_0_0_0_0_0_/_new/in.txt'
into table stock_table_static
CHARACTER SET UTF8
fields terminated by '\t'
lines terminated by '\n'
ignore 1 lines
(my_Code,my_StockRating,my_StockRating_tmp,my_Date,my_Fund,my_Shares,... ... unnecessary);
提示是這些欄位不少是空的,就是默認是''。感覺這個很可能是一個原因。
查詢就是這樣

如何消除這些例外呢,感覺以后問題會越積越多
請指點指點,謝謝。
uj5u.com熱心網友回復:
試試直接弄成CSV格式的,txt 和excel在某些系統和版本下是會有問題的轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/15006.html
標籤:MySQL
下一篇:SQL 2019安裝
