Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
178 views
in Technique[技术] by (71.8m points)

datetime - How to fix a field in a specifc row due to an error?

Question: How do you identify which record exists in a specific row that is causing an error?

I have a large table that was imported from a CSV that had a date (DATETIME format) column that was imported originally as a VARCHAR field. I converted the column directly using a STR_TO_DATE command that appeared to work well in a data subset test table.

However, when converting the column to a DATETIME format after the column conversion to the DATETIME format using:

ALTER TABLE table_name MODIFY COUMN column5 DATETIME; in the real data table I received the following error:

ERROR 1292 (22007): Incorrect datetime value: '' for column 'RegistrationDate' at row 836784

Although each row should have one column that is a unique number I am at a loss as to how to identify the offending record to see why it is producing the error and fix it? Everything I have read mentions not being unable to return a record set by a specific row number?

Any help appreciated.

question from:https://stackoverflow.com/questions/65867040/how-to-fix-a-field-in-a-specifc-row-due-to-an-error

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...