我想在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左试右试都无法解决,不知哪位大侠能够指点一下,谢了!

解决方案 »

  1.   

    update table1 set table1.xx = '1' where aa in
    (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 
    );
      

  2.   

    用trigger试下 after update
      

  3.   


    我在MySql中试了一下,报错了:
    You can't specify target table 'table1' for update in FROM clause
      

  4.   

    oracle无法测试,不知会不会测试这样的错误
      

  5.   

    汗,MYSQL和ORACLE的SQL 不通用,除非是标准SQL,还是有点区别的
      

  6.   

    update table1 set table1.xx = '1' 
    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)
      

  7.   

    update table1 set table1.xx = '1' 
    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)
      

  8.   

    弱弱的文问一下,“select 1”是什么意思?