Home > database > With the LOAD DATA import DATA, the first character always be truncated
With the LOAD DATA import DATA, the first character always be truncated
Time:10-19
Novice, Need to use the load data import company data, first as a date, format for characters such as "201507", I under table definition first as a string of six, and such as s_month varchar (6), import the data statement The Load Data InFile 'D:/1/2015-821. The CSV Into Table ` ori_2015_821 ` fields terminated by', 'lines terminated by' \ n ';
System error: 1265 Data truncated for column 's_month' at row 1
Query tables are finding the first line of the first data is truncated to "20150"
When building table is modified to varchar (7), then the system is not an error, but using the group by statement, summary contains two 201507
Please everyone a great god take on the road, help to solve this problem
CodePudding user response:
Varchar (6) can save six characters, you can check whether there is a space not found, as to collect duplicate, should be the data transfer or SQL statement out of the question
CodePudding user response:
Don't have specific data, the estimate is the data format is not standard, how many lines you see the error, open the data file, see if there is a problem