【发布时间】:2019-11-13 08:20:37
【问题描述】:
我正在使用以下语句查询一列:
SELECT t1.col1 from table1 t1, table2 t2
WHERE t1.col1 = t2.col2 and t2.col3 IN (data1, data2);
我正在尝试更新满足上述 where 条件的 t1.col1,但出现错误。
这是我尝试过的更新语句:
update t1 set t1.col1 = 1 from table1 t1 INNER JOIN table2 t2 where t2.col3 IN ( data1, data2 );
如果列出的数据与 t2.col3 中的数据匹配,我想更新 t1.col1 的值
【问题讨论】:
标签: database db2 sql-update inner-join