| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1857 人关注过本帖
标题:=all的使用问题
只看楼主 加入收藏
六年
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-10-4
收藏
 问题点数:0 回复次数:2 
=all的使用问题
已创建表depositor 和 account2,分别有属性account2_number、customer_name以及account2_name、branch_name、balance。
在oracle中输入以下语句,目的是找出在Brooklyn的所有支行都有帐户的客户

select distinct D.customer_name
from depositor D
where (select branch_name
       from depositor T,account2 R
       where T.account2_number = R.account2_number
       and
       D.customer_name = T.customer_name)
       =all
       (select branch_name
       from branch
       where branch_city = 'Brooklyn')
返回
Error report:
SQL Error: ORA-01427: 单行子查询返回多个行
01427. 00000 -  "single-row subquery returns more than one row"
请问为什么?
本人是新手,刚学数据库没几天。写这个的另一目的是为了看看=all的用法。因书上只是一笔带过,是否在这里出错了?
搜索更多相关主题的帖子: oracle balance where 帐户 
2007-11-29 19:39
elvis123
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2007-11-24
收藏
得分:0 
=ALL要等於子查詢中所有值
2007-11-30 19:25
ILoveMK
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:487
专家分:0
注 册:2007-2-12
收藏
得分:0 
有这个关键字啊?

天下归心
2007-11-30 19:44
快速回复:=all的使用问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013704 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved