Posted at

SELECTした結果をUPDATEする

More than 3 years have passed since last update.

UPDATE

hogehoge, (SELECT hogehoge.id

FROM hogehoge

INNER JOIN hugahuga

ON hogehoge.id = hugahuga.hogehoge_id) as tmp

SET hogehoge.hoge_flg = 2

WHERE hogehoge.id = tmp.id