Unexpected update count received. Changes'll is rolled back. Sql:delete from ' MyProject '. ' Role_module ' WHERE ' role_id ' =? and ' module_id ' =?

Source: Internet
Author: User

数据库中存在重复数据,想要通过控制台 "-" 操作删除或者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'll is rolled back. Sql:delete from ' MyProject '. ' Role_module ' WHERE ' role_id ' =? and ' module_id ' =?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.