select no,money
from (select dscardno no,money from a
union all
select cardno no ,money from b) t
group by no
from (select dscardno no,money from a
union all
select cardno no ,money from b) t
group by no
解决方案 »
- ORCLE存储过程循环取值问题
- 请教改一个SQL语句
- *******小女子有事需要大家帮忙?(从VFP库中取数据至Oracle(望邹健及各位高手请不吝赐教)*****
- oracle11g rac内存使用率不断上升,从开始的50%现在已超过90%,可能是什么原因,如何降低使用率,谢谢!
- 用过ACCESS链接ORACLE数据库的人进来!
- 在 red hat linux9中 安装ORACLE9时出现了错误!!
- 各位兄弟,我问一个oracle 的SQL语句问题?请各位多多帮忙?
- 这个语句无法执行,怎么回事?
- 请问删除表空间的SQL语句是什么?
- 高分求oracle for unuxware7.11的下载网址,急,必结贴!!!
- Oracle 10g 如何将文本导入到一张表里呢?
- 请教个视图制作问题!
from (select dscardno no,money from a
union all
select cardno no ,money from b) t
group by no
不好意思
漏了关键字了
where exists (select 1 from a where a.dscardno=b.cardno);update b set money=nvl((select money from a where a.dscardno=b.cardno),money);
where b.cardno in (select dscardno from a)
这个应该很简单的把
我会在MSSQL里用,但在oracle中就不能用了
也方便别人帮你分析,没有互动的话心有余而力不足啊~~说实话,简单的一个“不行”很让人心冷。
---------- ----------
10001 5
10003 6
10004 3SQL> select * from b;CARDNO MONEY
---------- ----------
10001 1
10002 1
10003 1
10004 1SQL> update b set money=(select money from a where a.dscardno=b.cardno)
2 where exists (select 1 from a where a.dscardno=b.cardno);已更新3行。SQL> select * from b;CARDNO MONEY
---------- ----------
10001 5
10002 1
10003 6
10004 3SQL> 用的zmgowin(hermit)的语句,请问哪里不行了?
update b set money=decode((select money from a where a.dscardno=b.cardno),null,money,(select money from a where a.dscardno=b.cardno))
请多提供一些错误情况,大家帮你分析问题好吗?
如果该TOOLS工具不提供错误信息,那么我建议你抛弃它,因为不够友好~~~
如果提供错误信息,请原封不动的拷贝到CSDN上来,好吗?
where exists (select 1 from a where a.dscardno = b.cardno);update b set b.money=(select a.money from a where a.dscardno = b.dscardno)
where b.dscardno in (select a.dscardno from a);update b set b.money=nvl((select a.money from a where a.dscardno=b.cardno),money);