首页 > 数据库 >mysql 报错 1292 - Truncated incorrect DECIMAL value

mysql 报错 1292 - Truncated incorrect DECIMAL value

时间:2022-11-23 10:45:22浏览次数:36  
标签:incorrect Truncated DECIMAL 字段 报错 mysql 1292

数据库维护之时,报错1292
sql如下

update 表1
left join 表2 on 表1.关联字段 = 表2.关联字段
set 表1.更新字段 = 表2.字段
where 表2.字段 != '' 
and 表2.字段 !='#VALUE!' 
and 表2.字段 != 0 
and 表2.字段 != '0' 
and 表2.字段 is not null

因为数据库中脏数据较多,所以有了较多的where条件
报错信息显示:正在尝试比较WHERE or ON子句中的数字和字符串
问题出在 表2.字段 != 0上面,注释掉即可

标签:incorrect,Truncated,DECIMAL,字段,报错,mysql,1292
From: https://www.cnblogs.com/meizhengchao/p/16917548.html

相关文章