我需要更新我的數據庫它是一個基於在locationId的MySQL更新查詢
update device d
set d.deleteDate='2016-05-07'
where d.id in (select dtg.deviceId from devicestogroups dtg
where dtg.groupId in (select g.id from `group` g
where g.locationId ='1'));
當我運行查詢我得到的錯誤多行軟刪除:
Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect.
子查詢將返回我2記錄,因爲我知道,因爲子查詢返回兩個記錄更新不會發生,但我該如何解決這個問題。我試圖解決但不成功。
感謝@Suraz! – suresh