【转】Data truncation: Truncated incorrect DOUBLE value:Mysql Update时

 
 

转自http://blog.csdn.net/iwtbavcp/article/details/6455704

真的是一篇很冷的帖子,解决了我的大问题

 

Mysql Update  sData truncation: Truncated incorrect DOUBLE value:??s

最近用JSP和mysql做个东西,遇到一个问题:

当使用update语句时出现Data truncation: Truncated incorrect DOUBLE value:??错误.

我的一个sql语句这样是:update users set userPwd='12345678' and userRealName='管理员' where userName='guoweibin';这个执行没问题

另一个sql语句与上一个格式一样,不同的是and连得列比较多,就出现了上面的这个错误.

在百度上搜索了半天,也没结局.

没想到最后,一篇很冷的帖子,解决了我的问题

只要把update语句中的and换成逗号就行了.

比如

 update users set userPwd='12345678',suserRealName='管理员' where userName='guoweibin';

如果有更多的列,就用逗号连接.

 

原文地址:https://www.cnblogs.com/todoit/p/2706538.html