MySql - Update table using select statment from same table

前端 未结 5 487
执念已碎
执念已碎 2020-12-01 11:49

I\'m trying to update row in a table using values from a different row (and different columns) in the same table. Something along the lines of this, although my syntax produ

5条回答
  •  暖寄归人
    2020-12-01 12:27

    Adding..

    Same tables, with more of one registers

    UPDATE table t1
    INNER JOIN table t2 ON t2.entry_id = t1.entry_id
    SET t1.field_id_60 = t2.field_id_60,
        t1.field_id_61 = t2.field_id_61
    

提交回复
热议问题