话不多说,简单的总结而已。网络上很多很详细介绍。

例如,博文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) ;

最新文章

  1. Oracle学习笔记六 SQL常用函数
  2. mas_makeConstraints && mas_remakeConstraints && mas_updateConstraints 用法与注意事项
  3. 原创:跳坑指南——微信小程序真机预览跟本地不同的问题
  4. linux集群时钟问题
  5. js 事件
  6. Nodejs爬虫进阶=>异步并发控制
  7. Asp.net上传文件Request.files获取不到文件
  8. [CSS]三角形
  9. Python第一个入门程序
  10. C#动态增加边框
  11. 论JSON的重要性☞异步上传过程中data取多组值的方法
  12. Java和Flex整合报错(二)
  13. node之子线程child_process模块
  14. 高可用Redis(一):通用命令,数据结构和内部编码,单线程架构
  15. Centos 7 图形安装笔记(超详细)
  16. 走你!Github 开源整合
  17. AngularJS ui-router刷新子页面路由
  18. Luogu4783 【模板】矩阵求逆(高斯消元)
  19. ODBC的基础架构
  20. 关于JqueryCheck选中获取数据

热门文章

  1. matlab 学习之常用函数2
  2. strpos与strstr之间的区别
  3. pjax简单实例
  4. ios中实现对UItextField,UITextView等输入框的字数限制
  5. l两张图片轮播
  6. 计算机网络--DNS
  7. js闭包实际用途
  8. GOLANG 1.9 语言规范
  9. PCA tries to preserve linear structure, MDS tries to preserve global geometry, and t-SNE tries to preserve topology (neighborhood structure)
  10. VC调用Delphi DLL