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 条件需要你再考虑,保证返回值的唯一性。
解决方案 »
- 据说直接使用SQL Developer连接ORACLE的话,可以不用安装Oracle的客户端
- 急!ORA-29701: unable to connect to Cluster Manager 求解决办法
- 表与表之間的比較
- 初学者,2个简单的小问题?
- oracle pl/sql developer 如何在test窗口打断点啊
- 怎么把字符串最后2位换成'00'
- 菜鸟求救!!!! insert or copy数据的问题?——————在线等!!!!!!!!!!
- 请问oracle默认的管理员密码和帐号是什么?(在线等待)
- 怎样使用VB(+ADO)备份和还原Oracle中的数据库
- 真的是windows内部错误吗?
- 请问,如何让序列对象一次增长大于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'
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'