I am trying to update a table using the following query
update at_product A join
(
SELECT atbillfields.billeditemguid,count(*) AS numberOfPeopleBought
,s
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.
This error means you're operating in safe update mode and therefore you have two options:
SET SQL_SAFE_UPDATES = 0;
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.
In MySQL 5.5
, if you're using MySQL Workbench
then
Edit
--> Preferences
"SQL Queries"
tab and uncheck "Safe Updates"
check box.Query
--> Reconnect to Server (logout
and then login
)This works.