討論串[SQL ] MySQL Update指令的問題 (self)
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者evernever (!!M)時間15年前 (2010/04/28 17:48), 編輯資訊
0
0
0
內容預覽:
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). --. 發信站

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者rogertu (Innocent World)時間15年前 (2010/04/28 14:57), 編輯資訊
0
0
0
內容預覽:
沒測試過,不過是否可以使用別名?. 例如 update M set A=0 where B in (select m1.D from M as m1 where m1.C=0). 之類的.... --. 發信站: 批踢踢實業坊(ptt.cc). ◆ From: 118.168.202.152.

推噓0(0推 0噓 1→)留言1則,0人參與, 最新作者tabear (胖熊)時間15年前 (2010/04/28 12:14), 編輯資訊
0
0
0
內容預覽:
我用的是MySQL. 假設有一個table => M 裡面有4個欄位 A, B ,C, D. 所以我下面這個指令結果產生錯誤. update M set A=0 where B in (select D from M where C=0). 回傳訊息似乎是不能同table. 所以我就複製一樣的tab
(還有69個字)
首頁
上一頁
1
下一頁
尾頁