gpt4 book ai didi

mysql 在update 语句中使用cast 时出现错误1292

转载 作者:行者123 更新时间:2023-11-29 06:41:37 24 4
gpt4 key购买 nike

以下语句返回“错误代码:1292。截断了不正确的整数值:'95.00' 1.132 秒”

update new2006 set new2006.emp=cast(emp as unsigned) where IsNum(emp)=0;

但是如果我使用下面的语句,我可以成功得到结果95。

select cast(emp as unsigned) from new2006 where IsNum(emp)=0;

PS:emp的数据类型是varchar(7)

最佳答案

试试这个

update IGNORE new2006 set new2006.emp=cast(emp as unsigned) where IsNum(emp)=0;

关于mysql 在update 语句中使用cast 时出现错误1292,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21142273/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com