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

Posted 雨吃草

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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);

以上是关于mysql执行update语句时报错:Data truncation: Truncated incorrect DOUBLE value: 'null'的主要内容,如果未能解决你的问题,请参考以下文章