首页 文章

Mysql Update抛出错误1175

提问于
浏览
0

我想使用带有MySQL Workbench 6.2的MySQL 5.7在表中插入一些行 . 当我尝试它时,我得到错误1175(在安全更新模式下更新没有WHERE)

我的查询中有一个WHERE子句,它也过滤了表的PK .

这是它的样子:

> update inventory as inv
> 
> set   inv.fk_location          = null
>     , inv.location_description = null
> 
> -- only buffered rows 
> where inv.id_inventory in (
>     select tmp.id_inventory   
>     from tmp_inventory_location as tmp )

子选择提供两行,其中两个inventory_id也在我想要更新的表中 . 字段id_inventory也是具有UN AI PK设置的主键 . 所以,就我搜索它一切都应该没问题 . 还是我错过了一件事?我真的不喜欢更改该查询的安全更新模式 .

谢谢菲利克斯

1 回答

  • 0

    请遵循以下步骤 . 这可能有所帮助:

    • 转到编辑然后首选项

    • 转到 SQL Queries 选项卡并取消选中 Safe Updates 然后重新连接 .

相关问题