【发布时间】:2016-09-30 09:10:07
【问题描述】:
我需要一些帮助来创建更新查询。例如我有
select:(T1- table 1, T2- tables 2, Z1 -column from table 1, Z2 Column from table 2 etc)
Select * from T1,T2 where X1=X2 and Y1=Y2 and Z1=Z2 and Datea>=20160601 and Dateb<20160720 and B1=2 and C1=5 and D1=10 and E2 in (A+,A-, 22,33,44)
现在我想写一个使用参数的update
from where
update T1 set F1, G1 where
正确的条件怎么写?
【问题讨论】:
-
您可以在更新中执行子查询吗?
-
例如..UPDATE TABLENAME SET F1 = (SELECT * FROM)
-
对不起,我写错了。更新应该像 update T1 set F1=10, G1=50 where
-
您仍然可以在每个 SET 语句中使用子查询来获得该值吗?
-
解决方案可能是更新 T1 设置 F1=10, G1=50 where exists (Select * from T1,T2 where X1=X2 and Y1=Y2 and Z1=Z2 and Datea>=20160601 and Dateb