How to do 3 table JOIN in UPDATE query?

后端 未结 6 2052
走了就别回头了
走了就别回头了 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:01

    For PostgreSQL example:

    UPDATE TableA AS a
    SET param_from_table_a=FALSE -- param FROM TableA
    FROM TableB AS b
    WHERE b.id=a.param_id AND a.amount <> 0; 
    

提交回复
热议问题