update one table with data from another

后端 未结 5 797
孤独总比滥情好
孤独总比滥情好 2020-11-27 02:36

Table 1:

id    name    desc
-----------------------
1     a       abc
2     b       def
3     c       adf

Table 2:

id    na         


        
5条回答
  •  没有蜡笔的小新
    2020-11-27 03:25

    Use the following block of query to update Table1 with Table2 based on ID:

    UPDATE Table1, Table2 
    SET Table1.DataColumn= Table2.DataColumn
    where Table1.ID= Table2.ID;
    

    This is the easiest and fastest way to tackle this problem.

提交回复
热议问题