oracle 中 in 和exists用法区别
2015-12-04 14:53
441 查看
select * from sc where cno='c001' and sno in(select sno from sc where cno='c002'); select * from sc where cno='c001' and exists(select sno from sc where cno='c002'); 请问这两句运行结果为什么不一样?
2013-09-11 20:41提问者采纳
是这样的 in 是返回的结果集 比如你只运行这一句 select sno from sc where cno='c002' 返回的是一列sno 但是exists则不同,返回的是布尔值 虽然里边那个没法单独运行 select * from sc a where cno='c001' and exists(select sno from sc b where cno='c002' and a.sno=b.sno) ; 后边必须要写上两者的关联
相关文章推荐
- oracl密码过期解决方案
- oracle 驱动安装备忘
- Oracle RAC OCR 和 VotingDisk 的备份与恢复
- oracle 报Ora-01008错误:oracle 并非所有变量都已绑定的原因.TO_number();动态执行select..into..语句时
- AIX filesystemcache引发的Oracle事故
- Oracle的left join中on和where的区别
- oracle对象
- How to resolve ORA-19706 error when select from dblink
- Oracle存储过程例子游标异常
- 关于oracle时间格式to_date函数
- jsp + tomcat 连接Oracle数据实例
- oracle定时调用存储过程
- oracle的decode函数在mysql的实现
- Linux下oracle定时备份 ftp上传到指定机器
- oracle hints的用法总结
- oracle 触发器生成主键的
- Oracle Blob字段转换为String类型
- Oracle 自定义过程与函数
- [ORACLE]从两个简单的存储过程看绑定变量的重要
- CRS-4124: Oracle High Availability Services startup failed.