<正则吃饺子> :关于oracle 中 exists 、not exists 的简单使用
话不多说,简单的总结而已。网络上很多很详细介绍。
例如,博文:http://blog.csdn.net/zhiweianran/article/details/7868894 当然这篇也是转载的,原创地址就不深究了。学习就好。
具体的可以参照这个博文地址,介绍的还是比较详细的。
---我的简单记录,如下:
select * from a ;
insert into a(id,name) values(1,'name1');
insert into a(id,name) values(2,'name2');
insert into a(id,name) values(3,'name3');
select * from b ;
insert into b(id,aid,bname) values(1,1,'bname1');
insert into b(id,aid,bname) values(2,2,'bname2');
insert into b(id,aid,bname) values(3,2,'bname3');
exists (sql 返回结果集为真)
not exists (sql 不返回结果集为真)
--exists
select * from a where exists (select * from b where b.aid = a.id) ;
--in
select * from a where a.id in (select b.aid from b where b.aid = a.id) ;
-- not exists
select * from a where not exists (select * from b where b.aid = a.id) ;
--not in
select * from a where a.id not in (select b.aid from b where b.aid = a.id) ;
最新文章
- Oracle学习笔记六 SQL常用函数
- mas_makeConstraints &;&; mas_remakeConstraints &;&; mas_updateConstraints 用法与注意事项
- 原创:跳坑指南——微信小程序真机预览跟本地不同的问题
- linux集群时钟问题
- js 事件
- Nodejs爬虫进阶=>;异步并发控制
- Asp.net上传文件Request.files获取不到文件
- [CSS]三角形
- Python第一个入门程序
- C#动态增加边框
- 论JSON的重要性☞异步上传过程中data取多组值的方法
- Java和Flex整合报错(二)
- node之子线程child_process模块
- 高可用Redis(一):通用命令,数据结构和内部编码,单线程架构
- Centos 7 图形安装笔记(超详细)
- 走你!Github 开源整合
- AngularJS ui-router刷新子页面路由
- Luogu4783 【模板】矩阵求逆(高斯消元)
- ODBC的基础架构
- 关于JqueryCheck选中获取数据
热门文章
- matlab 学习之常用函数2
- strpos与strstr之间的区别
- pjax简单实例
- ios中实现对UItextField,UITextView等输入框的字数限制
- l两张图片轮播
- 计算机网络--DNS
- js闭包实际用途
- GOLANG 1.9 语言规范
- PCA tries to preserve linear structure, MDS tries to preserve global geometry, and t-SNE tries to preserve topology (neighborhood structure)
- VC调用Delphi DLL