社区
基础和管理
帖子详情
select查询出错single-row subquery returns more than one row
superquestions
2010-03-20 09:52:42
出错原因是
select x from tablea where column=(select b from tableb)
而子查询返回的结果不止一条
按这个情况查询,有没有办法解决不出错又能查询到?
...全文
713
9
打赏
收藏
select查询出错single-row subquery returns more than one row
出错原因是 select x from tablea where column=(select b from tableb) 而子查询返回的结果不止一条 按这个情况查询,有没有办法解决不出错又能查询到?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
ORACLE800
2010-03-22
打赏
举报
回复
[Quote=引用 2 楼 adebayor 的回复:]
select x from tablea where column in(select b from tableb);
[/Quote]
支持.
xiaoheixiaobai
2010-03-22
打赏
举报
回复
1,select x from tablea where column=any(select b from tableb)
2,select x from tablea where column in(select b from tableb);
3,select x from tablea a where exists
(select 1 from tableb b
where b.b=a.column
);
这三种方法,习惯用第三种,不知道具体的执行效率是怎么样的,请高人指教。
hebo2005
2010-03-22
打赏
举报
回复
几种方法,效率各不同
如2楼
select x from tablea where column in(select b from tableb);
还可以用EXISTS,大部分情况比IN的效率高
select x from tablea a where exists
(select 1 from tableb b
where b.b=a.column
);
Raul_Gonzalez
2010-03-22
打赏
举报
回复
SELECT a.x
FROM tablea a, tableb b
WHERE a.COLUMN = b.b
huangyunzeng2008
2010-03-22
打赏
举报
回复
select x from tablea where column=(select b from tableb where rownum=1)
wildoracle
2010-03-21
打赏
举报
回复
[Quote=引用 1 楼 suiziguo 的回复:]
select x from tablea where column=any(select b from tableb)
[/Quote]
可以实现
liugh_dba
2010-03-20
打赏
举报
回复
一般 “1 = N”时就会报这个错,看你的实际用途,是在一个范围内的话可以采用上述方法,这种错误也经常在DML 语句中出现!
Adebayor
2010-03-20
打赏
举报
回复
select x from tablea where column in(select b from tableb);
suiziguo
2010-03-20
打赏
举报
回复
select x from tablea where column=
any
(select b from tableb)
如何使用MySQL一个表中的字段更新另一个表中字段
1,修改1列 update student s, city c set s.city_name = c.name where s.city_code = c.code; 2,修改多个列 update a, b set a.title=b.title, a...oracle
查询
报这个错误:
single
-
row
subquery
return
s more than o
微软内部资料-SQL性能优化5
After the nonclustered key at the leaf level of the index is found, only one more page access is needed to find the data
row
. Searching for a
single
row
using a nonclustered index is almost as ...
Delphi7.1 Update
If you encounter an empty Help Index tab after installing this update, open the d7.ohi file in the Delphi7Help folder and comment out one or more of the index entries by changing the colon in column ...
ORA-01427:
single
-
row
subquery
return
s more than one
row
今天开发的同事反馈一个问题,该程序已经... 图1 OR-01427:
single
-
row
subquery
return
s more than one
row
异常为:单行子
查询
返回多行 我得到了该
查询
页面对应的sql语句:
SELECT
ID,(
SELECT
NAME FROM TABL
ORA-01427:
single
-
row
subquery
return
s more than one
row
ORA-01427:
single
-
row
subquery
return
s more than one
row
我用了
row
id 来获得数据,并且用Implicit Cursors(
select
into )来获取数据,出现返回...
基础和管理
17,377
社区成员
95,128
社区内容
发帖
与我相关
我的任务
基础和管理
Oracle 基础和管理
复制链接
扫一扫
分享
社区描述
Oracle 基础和管理
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章