<正则吃饺子> :关于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 中 exists 、not exists 的简单使用的更多相关文章
- <正则吃饺子>:关于java中垃圾回收技术的简单学习总结
知识介绍来自网络,后面会根据继续学习进行补充和适当的修改,谢谢!原文地址:http://www.importnew.com/26821.html#comment-578355 java中的垃圾回收机制 ...
- Oracle中没有 if exists(...)
对于Oracle中没有 if exists(...) 的语法,目前有许多种解决方法,这里先分析常用的三种,推荐使用最后一种 第一种是最常用的,判断count(*)的值是否为零,如下declare v ...
- ORACLE 中IN和EXISTS比较
ORACLE 中IN和EXISTS比较 EXISTS的执行流程 select * from t1 where exists ( select null from t2 where y = x ...
- [转]Oracle中没有 if exists(...)
本文转自:http://blog.csdn.net/hollboy/article/details/7550171 对于Oracle中没有 if exists(...) 的语法,目前有许多种解决方法, ...
- Oracle中没有 if exists(...)的解决方法
http://blog.csdn.net/hollboy/article/details/7550171对于Oracle中没有 if exists(...) 的语法,目前有许多种解决方法,这里先分析常 ...
- <正则吃饺子> :关于oracle 中 with的简单使用
oracle中 with的简单使用介绍,具体可以参见其他的博文介绍,在这里只是简单的介绍: with 构建了一个临时表,类似于存储过程中的游标,我是这么理解的. 一.数据准备: select * fr ...
- <正则吃饺子>:关于使用powerDesign连接oracle数据库,导出数据表结构(ER图吧)
最近做的项目中,没有完整的数据库表结构图(ER图),自己就根据服务器上oracle数据库和powerdesign整理一份,但是存在两个问题:1.没有把数据库表的相关备注弄下来:2.数据库表中的主外键关 ...
- <正则吃饺子> :关于redis集群的搭建、集群测试、搭建中遇到的问题总结
项目中使用了redis ,对于其基本的使用,相对简单些,根据项目中已经提供的工具就可以实现基本的功能,但是只是这样的话,对于redis还是太肤浅,甚至刚开始时候,集群.多节点.主从是什么,他们之间是什 ...
- <正则吃饺子> :关于mybatis中使用的问题(一)
在公司项目开始之前,根据springboot .mybatis.Swagger2 整合了一个demo,在测试时候,遇到的问题,简单记录.之前在使用mybatis时候,没有注意到这一点. 1.错误:Th ...
随机推荐
- PowerBuilder -- 数据窗口
获取数据窗口列数 ls_colnum= integer(this.Describe("DataWindow.Column.Count")) 获取数据窗口列名 ls_colName ...
- sigar 监控服务器硬件信息
转载 http://www.cnblogs.com/jifeng/archive/2012/05/16/2503519.html 通过使用第三方开源jar包sigar.jar我们可以获得本地的信息 1 ...
- GS给客户单发包以及m_queGcWait(所有GC共享)
GS给客户单发包以及m_queGcWait(所有GC共享) send_stat BaseChannel::SendCmd(int nCmd, void* pData, int nLen) { Prot ...
- 【BZOJ2406】矩阵 二分+有上下界的可行流
[BZOJ2406]矩阵 Description Input 第一行两个数n.m,表示矩阵的大小. 接下来n行,每行m列,描述矩阵A. 最后一行两个数L,R. Output 第一行,输出最小的答案: ...
- ptyhon ORM mongoengine
参考资料:http://www.tuicool.com/articles/bMvI7vN from mongoengine import * from datetime import datetime ...
- Elasticsearch集群UNASSIGNED
Elasticsearch集群UNASSIGNED http://shineforever.blog.51cto.com/1429204/1859734 http://www.searchtech.p ...
- SQLServer中游标实例介绍(转)
引言 我们先不讲游标的什么概念,步骤及语法,先来看一个例子: 表一 OriginSalary 表二 AddSalary 现在有2张表,一张是OriginSal ...
- Oracle中日期和时间类函数
首先,在oracle中如何表示日期 操作日期时,应使用to_date('date','dateType')函数得到date类型,其中date为任意格式的日期,dateType指定其格式,如to_dat ...
- Method invoke 方法
这个问题要看明白源码才能解决
- 我的Android进阶之旅------>Handlerr.removeCallbacksAndMessages(null)的作用
今天都到一段代码,在onDestroy()方法中,使用了下面的代码: mHandler.removeCallbacksAndMessages(null); 一开始我完全看不懂,我为什么参数是null, ...