Update query failing with error : 1175

前端 未结 4 1663
礼貌的吻别
礼貌的吻别 2020-12-07 02:17

I am trying to update a table using the following query

update at_product A join
(
SELECT atbillfields.billeditemguid,count(*) AS numberOfPeopleBought
    ,s         


        
相关标签:
4条回答
  • 2020-12-07 02:35

    You can try on MysqlWorkbench

    Go to Edit --> Preferences

    Click "SQL Editor" tab and uncheck "Safe Updates" check box

    Query --> Reconnect to Server (logout and then login)

    I hope it is helpful for you.

    0 讨论(0)
  • 2020-12-07 02:37

    This error means you're operating in safe update mode and therefore you have two options:

    • you need to provide a where clause that includes an index for the update to be successful or
    • You can disable this feature by doing SET SQL_SAFE_UPDATES = 0;
    0 讨论(0)
  • 2020-12-07 02:51

    Have a look at:

    http://justalittlebrain.wordpress.com/2010/09/15/you-are-using-safe-update-mode-and-you-tried-to-update-a-table-without-a-where-that-uses-a-key-column/

    If you want to update without a where key you must execute

    SET SQL_SAFE_UPDATES=0;
    

    right before your query.

    Another option is to rewrite your query o include a key.

    0 讨论(0)
  • 2020-12-07 02:56

    In MySQL 5.5, if you're using MySQL Workbench then

    • Go to Edit --> Preferences
    • Click "SQL Queries" tab and uncheck "Safe Updates" check box.
    • Query --> Reconnect to Server (logout and then login)

    This works.

    0 讨论(0)
提交回复
热议问题