在测试Mybatis持久层更新语句时
update person set name = #{name} and sex = #{sex} where id=#{id}
出现 以下错误
Data truncation: Truncated incorrect DOUBLE value:
查找资料后发现多参数修改时不能用and连接,and连接会使参数转换为double型数据,数据库不是这个数据就会报Data truncation: Truncated incorrect DOUBLE value:
解决方法:
使用 , 连接
修改后的语句
update person set name = #{name} , sex = #{sex}
where id=#{id}