Advanced MySql Query: Update table with info from another table

前端 未结 3 1526
长发绾君心
长发绾君心 2020-11-29 02:40

I would like to update a table in mySql with data from another table.

I have two tables \"people\" and \"business\". The people table is linked to the business tabl

3条回答
  •  余生分开走
    2020-11-29 03:32

    Try this, it works fine for me.

    Update table a, table b
    Set a.importantField = b.importantField,
    a.importantField2 = b.importantField2
    where a.matchedfield = b.matchedfield;
    

提交回复
热议问题