MySQL使用一张表的字段更新另一张表的字段

转自https://blog.csdn.net/anxpp/article/details/73173274

    update table1 t1 left join table2 t2 on t1.key=t2.key set
    t1.field1=t2.field1,
    t1.field2=t2.field2,
    t1.field3=t2.field3
    where t1.field4 is null and t2.field4 > '2017-04-27';

 

posted on 2018-05-14 10:25  lijingran  阅读(483)  评论(0编辑  收藏  举报

导航