sqlserver语法
update tablea set tablea_column=tablea_column-tableb_column from tableb where tablea_id=tableb_id请问oracle语法怎么写?

解决方案 »

  1.   

    update table a set table a_col = (select tablea_column-tableb_column  fromm tablea a,tableb b where a.tablea_id=b.tableb_id )
      

  2.   

    update table a set tablea_column = (select a.tablea_column-b.tableb_column  fromm tablea a,tableb b where a.tablea_id=b.tableb_id )
      

  3.   

    update table a 
    set table a_column = (select a.tablea_column-b.tableb_column  fromm tableb b where tablea_id=b.tableb_id )
    就OK拉
      

  4.   

    update tablea a
    set tablea_column = tablea_column - (select tableb_column from tableb 
                                        where a.tablea_id=tableb_id)
    where exists (select null from tableb 
                  where a.tablea_id = tableb_id)