当前位置:Gxlcms > 数据库问题 > mysql执行update语句时报错:Data truncation: Truncated incorrect DOUBLE value: 'null'

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

时间:2021-07-01 10:21:17 帮助过:25人阅读

出现这个问题的原因网上有说是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'

标签:log   char   update   字段   ati   pre   user   div   truncate   

人气教程排行