How to do 3 table JOIN in UPDATE query?

后端 未结 6 2054
走了就别回头了
走了就别回头了 2020-11-21 07:00

I asked a question and got this reply which helped.

   UPDATE TABLE_A a JOIN TABLE_B b 
   ON a.join_col = b.join_col AND a.column_a = b.column_b 
   SET a.c         


        
6条回答
  •  时光取名叫无心
    2020-11-21 08:00

    Alternative way of achieving same result is not to use JOIN keyword at all.

    UPDATE TABLE_A, TABLE_B
    SET TABLE_A.column_c = TABLE_B.column_c + 1
    WHERE TABLE_A.join_col = TABLE_B.join_col
    

提交回复
热议问题