MySQL update table based on another tables value

前端 未结 7 1407
心在旅途
心在旅途 2020-11-22 15:20

I have a two tables,

Here is my first table,

ID      SUBST_ID        CREATED_ID
1       031938          TEST123
2       930111          COOL123
3             


        
7条回答
  •  难免孤独
    2020-11-22 16:00

    I think this should work

    UPDATE secondTable
    JOIN firsTable ON secondTable.SERIAL_ID = firsTable.SUBST_ID
    SET BRANCH_ID = CREATED_ID
    

提交回复
热议问题