我想在Oracle中实现
update table1 set table1.xx = '1'
where table1.aa = table2.aa
and table1.bb = table2.bb
and table2.cc = table3.cc
and table3.cc = :varcc左试右试都无法解决,不知哪位大侠能够指点一下,谢了!
update table1 set table1.xx = '1'
where table1.aa = table2.aa
and table1.bb = table2.bb
and table2.cc = table3.cc
and table3.cc = :varcc左试右试都无法解决,不知哪位大侠能够指点一下,谢了!
(select table1.aa from table1,table2,table3
where table1.aa = table2.aa
and table1.bb = table2.bb
and table2.cc = table3.cc
and table3.cc = :varcc
);
我在MySql中试了一下,报错了:
You can't specify target table 'table1' for update in FROM clause
where exists(select 1 from table2,table3
where table1.aa = table2.aa
and table1.bb = table2.bb
and table2.cc = table3.cc
and table3.cc = :varcc)
where exists(select 1 from table2,table3
where table1.aa = table2.aa
and table1.bb = table2.bb
and table2.cc = table3.cc
and table3.cc = :varcc)