7
我想在更新语句中加入三个表,但到目前为止我一直没有成功。我知道这个查询适用于连接两个表:在更新语句中加入多个表
update table 1
set x = X * Y
from table 1 as t1 join table 2 as t2 on t1.column1 = t2.column1
然而,在我的情况,我需要联接三个表,以便:
update table 1
set x = X * Y
from table 1 as t1 join table 2 as t2 join table3 as t3
on t1.column1 = t2.column1 and t2.cloumn2 = t3.column1
将无法工作。我也试过以下查询:
update table 1
set x = X * Y
from table 1, table 2, table 3
where column1 = column2 and column2= column3
有没有人知道一种方法来完成这个?
不Ÿ来自什么表? – 2012-07-16 20:13:33