[英]SQL Update after INNER JOIN two tables
I would like Update
two tables on the same Update
statement with INNER JOIN
but I cant attach second table 我想使用
INNER JOIN
在同一Update
语句上Update
两个表,但无法附加第二个表
UPDATE T1 SET T1.status='test1', T2.status='test1'
FROM mytable1 T1
INNER JOIN table2 T2 ON T1.id=T2.id
WHERE parameters.....
But I cant use T2.status='test1'
error I am getting 但是我无法使用
T2.status='test1'
错误
The multi-part identifier "T2.status" could not be bound.
多部分标识符“ T2.status”无法绑定。
You can't update 2 tables in a single update statement, even if using join clause. 即使使用join子句,也无法在单个update语句中更新2个表。 The join clause can be used for "filtering" purposes only.
join子句只能用于“过滤”目的。 Only FROM table can be updated.
仅FROM表可以更新。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.