本帖最后由 lzg827 于 2011-05-17 19:34:00 编辑

解决方案 »

  1.   

    oracle中不支持同时更新两张表的语法。
    写两个语句来更新。
      

  2.   


    update tbl1 A 
    set A.Status = 'S'
    where exists(
          select 1
          from tbl2 H
          where A.no = H.no 
            and A.Amount = H.Amount  
            and A.Status = H.Status)
    --
    update tbl2 H
    set H.status='S'
    where exists(
          select 1
          from tbl1 A
          where H.no=A.no
            and H.amount=A.amout
            and H.status=A.status)
      

  3.   

    貌似不能update两个表。自己搞定了。如下,update tbl2 H set (H.Status) = (select ''S'' from tbl1 A where A.no = H.no and A.Amount = H.Amount and A.Status = H.Status ) 
    BOBO12082119的方法应该也可行,不过exists这类语法的速度可以会有点慢,放分了。