How to update data in one table from corresponding data in another table in SQL Server 2005

前端 未结 8 1818
谎友^
谎友^ 2020-11-30 00:24

I have two tables in different databases on the same database server.

Both the databases have the same structure, but different data. Database1 (Test1) is the latest

8条回答
  •  一生所求
    2020-11-30 01:12

    UPDATE table1
    SET column1 = (SELECT expression1
                   FROM table2
                   WHERE conditions)
    [WHERE conditions];
    

提交回复
热议问题