mysql执行update语句时报错:Data truncation: Truncated incorrect DOUBLE value: 'null'

出现这个问题的原因网上有说是update的参数连接符要用,而不是and,但是我遇到的不是这个。

我出现问题的原因是,在update语句的where中varchar类型的字段我直接用了数字类型

update address set province = '北京' where userId = 250;

userId是varchar类型的,报错Data truncation: Truncated incorrect DOUBLE value: 'null'

改成这样就可以了

update address set province = '北京' where userId = concat(250);
posted @ 2018-02-06 09:54  雨吃草  阅读(7790)  评论(0编辑  收藏  举报