注册 登录
编程论坛 Oracle论坛

=all的使用问题

六年 发布于 2007-11-29 19:39, 1869 次点击
已创建表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的用法。因书上只是一笔带过,是否在这里出错了?
2 回复
#2
elvis1232007-11-30 19:25
=ALL要等於子查詢中所有值
#3
ILoveMK2007-11-30 19:44
有这个关键字啊?
1