Advanced MySql Query: Update table with info from another table

前端 未结 3 1522
长发绾君心
长发绾君心 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:37

    UPDATE business b, people p
       SET b.email = p.email
     WHERE b.business_id = p.business_id
       AND p.sort_order = '1'
       AND b.email = ''
    

提交回复
热议问题