update gzmx set cq =  (select nvl(a.bz,0)+nvl(b.bz,0) from cqwh a, cqwh b where a.bm = '1'  and b.bm = '2') and  a.rq = '2004-07' and a.rq=b.rq and a.... = gzmx....--where 条件需要你再考虑,保证返回值的唯一性。

解决方案 »

  1.   

    加上括号看看
    update gzmx set cq =  (select nvl(bz,0) from cqwh where bm = '1' )+( select nvl(bz,0) from cqwh where bm = '2') where rq = '2004-07'
    不行的话,装换一下类型
    update gzmx set cq =  to_number(select nvl(bz,0) from cqwh where bm = '1') +
    to_number( select nvl(bz,0) from cqwh where bm = '2') where rq = '2004-07'
      

  2.   

    试试这样:
    update gzmx set cq =  (select nvl(bz,0) from cqwh where bm = '1' and rownum<2 )+( select nvl(bz,0) from cqwh where bm = '2' and rownum<2) where rq = '2004-07'