开发者

How to insert,update and delete on currently

开发者 https://www.devze.com 2022-12-19 10:51 出处:网络
How to insert to mu开发者_StackOverflowltiple table, how to update one tables from it multiple tables and how to delete it multiple on currently?The only way to INSERT to multiple tables is to write m

How to insert to mu开发者_StackOverflowltiple table, how to update one tables from it multiple tables and how to delete it multiple on currently?


The only way to INSERT to multiple tables is to write multiple INSERT statements. Same goes for DELETE. They are single-table operations.

You can UPDATE one table using several other source tables with a simple JOIN like so:

UPDATE t1
    SET t1.Name = t3.Name
FROM Table1 t1
INNER JOIN Table2 t2
    ON t2.ID = t1.ID
INNER JOIN Table3 t3
    ON t3.OtherID = t2.OtherID
0

精彩评论

暂无评论...
验证码 换一张
取 消