同一TABLEを参照しアップデートする。

2019年4月27日
文字数[248文字] この記事は0分19秒で読めます.
同一TABLEを参照しアップデートする。 これでアップデートできる事を昨日知りました。
UPDATE demo1,(select chk from demo1 where id=1) as demo2 SET
demo = "2" where id = 1 and chk = demo2.chk;
--------------
--------------
/*
同一TABLEを参照しアップデートする。
table demo1
id,chk
1,123
*/
--------------