看板 Database 關於我們 聯絡資訊
update M set A=0 where B in (select D from M where C=0) 改成 update M set A=0 where B in (SELECT * FROM (select D from M where C=0) M1) ※ 引述《tabear (胖熊)》之銘言: : 我用的是MySQL : 假設有一個table => M 裡面有4個欄位 A, B ,C, D : 所以我下面這個指令結果產生錯誤 : update M set A=0 where B in (select D from M where C=0) : 回傳訊息似乎是不能同table : 所以我就複製一樣的table => M1 : 執行:update M set A=0 where B in (select D from M1 where C=0) 這樣就OK : 請問這有什麼方法可以解決的嗎?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 115.64.54.125
tabear:感恩 04/28 17:56