我,海东

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
    由于系统中出现了不完整的数据,需要从另一个表中把数据更新过来,在SqlServer中的写法如下:
    update table2
    set table2.cc=table1.bb
    from table1,table2
    where table1.aa=table2.aa
    在oracle中却无法执行,问了一个牛人,原来oralce要这样写:
    update table2  
    set table2.cc= (select table1.bb from table1 where table1.aa=table2.aa)
    where exists (select 1 from table1 where table1.aa=table2.aa )

    怪不得写oracle的人价钱高,不服不行。
posted on 2005-10-12 16:02  iseast  阅读(1249)  评论(3)    收藏  举报