BANCS_YYB_BAL 表有500条数据select c.ACTNO,b.invm_curr_bal from bancs.t_invm_w01 b,BANCS_YYB_BAL c
where b.invm_memb_cust_ac=c.actno and b.INVM_CURRENCY='CNY' and substr(b.INVM_GL_CLASSIFICATION_CODE,13,4) in (select tgt_apcode from tgt_apcode_bancs where tgt_num in ('0019','1002')))
这条语句只有一条记录,
按照道理下面的语句应该只更新一条记录,可却把5000条记录都更新了,不知道为什么
update BANCS_YYB_BAL a set a.bal=(select tb.invm_curr_bal from (select c.ACTNO,b.invm_curr_bal from bancs.t_invm_w01 b,BANCS_YYB_BAL c
where b.invm_memb_cust_ac=c.actno and b.INVM_CURRENCY='CNY' and substr(b.INVM_GL_CLASSIFICATION_CODE,13,4) in (select tgt_apcode from tgt_apcode_bancs where tgt_num in ('0019','1002'))) tb
where tb.actno=a.actno)
下面的语句,始终报错ora-00933,在from的地方,
update BANCS_YYB_BAL a set a.bal=tb.invm_curr_bal
from (select c.ACTNO,b.invm_curr_bal from bancs.t_invm_w01 b,BANCS_YYB_BAL c
where b.invm_memb_cust_ac=c.actno and b.INVM_CURRENCY='CNY' and substr(b.INVM_GL_CLASSIFICATION_CODE,13,4) in (select tgt_apcode from tgt_apcode_bancs where tgt_num in ('0019','1002'))) tb
where tb.actno=a.actno
where b.invm_memb_cust_ac=c.actno and b.INVM_CURRENCY='CNY' and substr(b.INVM_GL_CLASSIFICATION_CODE,13,4) in (select tgt_apcode from tgt_apcode_bancs where tgt_num in ('0019','1002')))
这条语句只有一条记录,
按照道理下面的语句应该只更新一条记录,可却把5000条记录都更新了,不知道为什么
update BANCS_YYB_BAL a set a.bal=(select tb.invm_curr_bal from (select c.ACTNO,b.invm_curr_bal from bancs.t_invm_w01 b,BANCS_YYB_BAL c
where b.invm_memb_cust_ac=c.actno and b.INVM_CURRENCY='CNY' and substr(b.INVM_GL_CLASSIFICATION_CODE,13,4) in (select tgt_apcode from tgt_apcode_bancs where tgt_num in ('0019','1002'))) tb
where tb.actno=a.actno)
下面的语句,始终报错ora-00933,在from的地方,
update BANCS_YYB_BAL a set a.bal=tb.invm_curr_bal
from (select c.ACTNO,b.invm_curr_bal from bancs.t_invm_w01 b,BANCS_YYB_BAL c
where b.invm_memb_cust_ac=c.actno and b.INVM_CURRENCY='CNY' and substr(b.INVM_GL_CLASSIFICATION_CODE,13,4) in (select tgt_apcode from tgt_apcode_bancs where tgt_num in ('0019','1002'))) tb
where tb.actno=a.actno
解决方案 »
- 创建临时表空间时指定tempfile和datafile有什么不同
- 有高人知道sqlplus 在linux 中默认路径是什么?
- ora-12560问题。急急急
- 开发过程中怎样来考虑并发性和死锁的问题
- 第三列等于前两列的计算结果,但前两列也是子查询怎么做
- 一个PL/SQL语句
- 合并数据字段问题
- 关于去除重复记录的问题!!
- Oracle9i Application Server Release 2 (9.0.3) for WIN2000的安装问题
- 请交:我在asp中使用如下语句sql2="insert into szh values('检泵',24)"为什么在sql plus 中查询却是“??,24“,而在sql plus 中用该
- 请帮忙,Oracle客户端错误提示,搞不定...
- 今天面试悲剧了~求指点求解答
update (select t1.a,t1.b,t2.c from t1,t2 where t1.a = t2.a) t3
set b = c ;
-- 上面这种语法要求select结果中包含要更新表的主键