1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

inner join で update

Last updated at Posted at 2021-01-13

初めに

よく使うけど忘れてしまうので記録として。

inner join で 結合したものをupdateしたい

UPDATE TableA 
  INNER JOIN TableB ON TableA.code_A = TableB.code_B 
    SET TableA.column_A = TableB.column_B 
  WHERE TableA.flag='1';"

もう一つ結合

UPDATE (TableA 
  INNER JOIN TableB ON TableA.code_A = TableB.code_B)
 INNER JOIN TableC ON TableA.code_A = TableB.code_C 
    SET TableA.column_A = TableB.column_B 
  WHERE TableA.flag='1';"
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?