“Truncated incorrect DOUBLE value”
的解决方法主要是这四种
:
1、修改了多个列的值而各列之间用逗号连接而不要用and
错误写法示例:
1 | update tablename set col1=value1 and col2=value2 where col3=value3; |
正确写法示例:
1 | update tablename set col1=value1,col2=value2 where col3=value3; |
2、SQL语句在拼接字符串时使用函数CONCAT()而不要用“+”
3、单数引号问题
1 | String sql= "UPDATE arrange SET askForLeave='是' WHERE employeeNum=“+employeeNum+” and arrangeDate=" +leaveDate; |
改成了
1 | String sql= "UPDATE arrange SET askForLeave='是' WHERE employeeNum='" +employeeNum+ "' and arrangeDate='" +leaveDate+ "'" |
在字符串变量前后加了单引号
4、在查询时查询条件的类型和字段类型不符
到此这篇关于MySQL提示Truncated incorrect DOUBLE value解决方法的文章就介绍到这了,更多相关MySQL Truncated incorrect内容请搜索IT俱乐部以前的文章或继续浏览下面的相关文章希望大家以后多多支持IT俱乐部!