Unexpected update count received. Changes will be rolled back. SQL: DELETE FROM `myproject`.`role_mo

Posted 楓与楪

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Unexpected update count received. Changes will be rolled back. SQL: DELETE FROM `myproject`.`role_mo相关的知识,希望对你有一定的参考价值。

数据库中存在重复数据,想要通过控制台 "-" 操作删除或者sql语句

 

DELETE FROM role_module WHERE role_id = 500 AND module_id=600;

 

删除 重复数据,两者执行结果相同,都会是:

Unexpected update count received. Changes will be rolled back. SQL: DELETE FROM `myproject`.`role_module` WHERE `role_id` = ? AND `module_id` = ?

 

因为执行 "-" 和语句对应的行数都是一行,而表中却有多条数据符合条件,因此数据库不知道该怎样执行了,因此不能执行而报错.

解决的办法就只将条件上一级删除(DELETE FROM role_module WHERE role_id = 500;).

以上是关于Unexpected update count received. Changes will be rolled back. SQL: DELETE FROM `myproject`.`role_mo的主要内容,如果未能解决你的问题,请参考以下文章

关于Error during managed flush [Batch update returned unexpected row count from update [0]; actual row

关于Hibernate级联更新插入信息时提示主键不为空的问题“org.hibernate.StaleStateException: Batch update returned unexpected r

failed to update local proxy configuration copy: unexpected field "hosts.available"解决(示例代码

R中执行if else报错:unexpected 'else' in "else"

Fetch POST Unexpected end of input Error

psql: FATAL: index "pg_opclass_oid_index" contains unexpected zero page at block 0 以及错误 r