社区
基础和管理
帖子详情
请教修改语句
zzxiaoma
2006-08-02 08:58:43
在oracle中
表 a
dscardno money
10001 5
10003 6
10004 3
表 b
cardno money
10001 1
10002 1
10003 1
10004 1
结果是:
表 b
cardno money
10001 5
10002 1
10003 6
10004 3
...全文
393
15
打赏
收藏
请教修改语句
在oracle中 表 a dscardno money 10001 5 10003 6 10004 3 表 b cardno money 10001 1 10002 1 10003 1 10004 1 结果是: 表 b cardno money 10001 5 10002 1 10003 6 10004 3
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
15 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zzxiaoma
2006-08-10
打赏
举报
回复
为什么都说可以呢,我用的是oracle9i,sql tools工具
gw_delphi
2006-08-10
打赏
举报
回复
update b set b.money=(select a.money from a where a.dscardno = b.dscardno)
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);
snowy_howe
2006-08-10
打赏
举报
回复
我是用oracle 客户端的sql*plus工具连接数据库的,不知道你说的SQL TOOLS工具又是什么呢?
请多提供一些错误情况,大家帮你分析问题好吗?
如果该TOOLS工具不提供错误信息,那么我建议你抛弃它,因为不够友好~~~
如果提供错误信息,请原封不动的拷贝到CSDN上来,好吗?
caoqizi
2006-08-09
打赏
举报
回复
呵呵,如果不想用snowy_howe(天下有雪) 兄的,用我这个试试,其实他那个应该不错的,我这个比较笨了点。
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))
zzxiaoma
2006-08-09
打赏
举报
回复
你难道真的测试过了吗????难道就没有问题吗
不能凭经验阿
你可以试试就知道后果了
snowy_howe
2006-08-03
打赏
举报
回复
SQL> select * from a;
DSCARDNO MONEY
---------- ----------
10001 5
10003 6
10004 3
SQL> select * from b;
CARDNO MONEY
---------- ----------
10001 1
10002 1
10003 1
10004 1
SQL> 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 3
SQL>
用的zmgowin(hermit)的语句,请问哪里不行了?
snowy_howe
2006-08-03
打赏
举报
回复
上面几个人提供的SQL语句到底发生什么错误?能贴出来吗?
也方便别人帮你分析,没有互动的话心有余而力不足啊~~
说实话,简单的一个“不行”很让人心冷。
zzxiaoma
2006-08-02
打赏
举报
回复
真的没有高手吗??
这个应该很简单的把
我会在MSSQL里用,但在oracle中就不能用了
zzxiaoma
2006-08-02
打赏
举报
回复
不行
lwk_hlj
2006-08-02
打赏
举报
回复
udpate b set money=(select money from a where a.dscorno=b.codno)
where b.cardno in (select dscardno from a)
zzxiaoma
2006-08-02
打赏
举报
回复
不行
sxykje
2006-08-02
打赏
举报
回复
555555555
更新不是查询
zmgowin
2006-08-02
打赏
举报
回复
update b set money=(select money from a where a.dscardno=b.cardno)
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);
sxykje
2006-08-02
打赏
举报
回复
select no,max(money)
from (select dscardno no,money from a
union all
select cardno no ,money from b) t
group by no
不好意思
漏了关键字了
sxykje
2006-08-02
打赏
举报
回复
select no,money
from (select dscardno no,money from a
union all
select cardno no ,money from b) t
group by no
Codeforces Round #559 (Div. 2) B. Expansion coefficient of the array
Let’s call an array of non-negative integers a1,a2,…,an a k-extension for some non-negative integer k if for all possible pairs of indices 1≤i,j≤n the inequality k⋅|i−j|≤min(ai,aj) is satisfied. The e...
Codeforces Round #559 (Div. 2)B. Expansion coefficient of the array
B. Expansion coefficient of the array time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Let's call an array of non-negative integers...
Codeforces Round #559 (Div. 2) B. Expansion coefficient of the array (思维)
⚓ ⚓ ⚓ 弯弯绕绕把自己绕晕了,, PS:最近CSDN在搞事情吗,怎么老是代码贴不出来
CodeForces Round #559 Div.2
A. A pile of stones #include <bits/stdc++.h> using namespace std; int N; string s; int main() { scanf("%d", &N); cin >> s; int len = s.length(); int ...
codeforces做题记录(Expansion coefficient of the array)(DIV2 B)
今天分享的是Codeforces Round #559 (Div. 2)的B题
基础和管理
17,377
社区成员
95,111
社区内容
发帖
与我相关
我的任务
基础和管理
Oracle 基础和管理
复制链接
扫一扫
分享
社区描述
Oracle 基础和管理
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章