SQL update fields of one table from fields of another one

前端 未结 7 584
傲寒
傲寒 2020-12-04 08:51

I have two tables:

A [ID, column1, column2, column3]
B [ID, column1, column2, column3, column4]

A will always be subset of

相关标签:
7条回答
  • 2020-12-04 09:35

    Try Following

    Update A a, B b, SET a.column1=b.column1 where b.id=1
    

    EDITED:- Update more than one column

    Update A a, B b, SET a.column1=b.column1, a.column2=b.column2 where b.id=1
    
    0 讨论(0)
提交回复
热议问题