MySQL 'Truncated incorrect INTEGER value'

前端 未结 6 1458
野趣味
野趣味 2020-12-11 01:57

I\'m getting an odd \'Truncated incorrect INTEGER value\' error when I run the following UPDATE query:

update tbl
set projectNumber = right(comments, 7)
wher         


        
6条回答
  •  星月不相逢
    2020-12-11 02:29

    Toby Speight has outlined one solution for the problem in his answer. I don't know if anybody will ever be as stupid as me, but to whom it may concern:

    I got Error code 1292 trying to modify the data type of a column IsDeleted from VARCHAR ('Y' => true, 'N' => false) to BIT.

    To resolve the problem: Update all 'Y's to '1's (UPDATE table SET isDeleted = '1' WHERE isDeleted = 'Y') and all 'N's to '0's, tried to modify the column type again and voila data type was modified PLUS the '1'-columns contain TRUE and vice-versa now.

提交回复
热议问题