今天在跟进站点访问量代码的时候,出现了如图的错误:

mysql 报错 Batch update returned unexpected row count from update [0]


百度之后发现该错误的原因是因为在执行saveOrUpdate修改数据库数据时,根据条件检索到多条数据,如图所示,

UPDATE 表 SET 字段 = val WHERE 条件 ,根据where条件能检索到两条以上的数据,那么执行update便会报错 

            Batch update returned unexpected row count from update [0];

mysql 报错 Batch update returned unexpected row count from update [0]

删除多余的数据就可以解决了 。


相关文章: