[MySQL] You are using safe update mode and you tried to update a table without a WHERE that uses a KEY colum

最近在接觸 MySQL,我在 MySQL Workbench 下 SQL 語法,有時候會出現下列文字訊息


Error Code: 1175
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY colum

不知道是系統預設就是 safe mode 還是怎樣,反正就是不給你下這個指令。在網路上查了一下,只要在語法前加上一段語法後,就可以了,語法如下:

SET SQL_SAFE_UPDATES=0;

DELETE FROM people WHERE person_status = 'deceased'

這樣就可以了跑下面這段語法了。

查詢資料來源網址:

    Blogger Comment

0 意見: