Oracle——集合运算
2015-09-17 16:51
465 查看
Oracle——集合运算
union 并集 : 去重并集 : 返回两个集合去掉相同部分的所有记录union all : 不去重并集 : 返回两个集合所有记录包括相同部分
intersect : 交集 : 返回两个集合相交的部分
minus : 差集 : 返回第一个集合,但不属于第二个集合的记录
---实例:union : 查询a表中10号部门和20部门的信息 select * from table_a where a_id =10 union select * from table_a where a_id =20 ---实例:union all:查询部门信息 select * from table_a union all select * from talbe_a ---实例:intersect: 查询部门的信息 select * from table_a intersect select * from table_b ---实例:minus:查询对应信息 当前信息的部门编号 存在于部门表中 但是不存在与员工表 select DEPARTMENT_ID from DEPARTMENTS minus select DEPARTMENT_ID from EMPLOYEES
相关文章推荐
- Oracle笔记——快速删除查询重复的数据
- Oracle笔记——分页查询
- Oracle笔记——常用函数
- Oracle笔记——number(p,s)
- Oracle锁表
- Oracle笔记——DDL
- oracle——安装图解
- Oracle——DML
- oracle恢复删除数据
- Oracle database 11.2.0.1 升级至 11.2.0.3
- oracle表和对象基础维护笔记
- Oracle--SQL技巧(多行记录用逗号拼接在一起)
- Oracle查询本周、本月、本年的记录
- 启动和停止Oracle服务bat脚本
- CentOs 7中安装Oracle 11g
- CentOS 7上启动Oracle 11.2.0.3
- Oracle中REGEXP_SUBSTR函数的使用
- Oracle Package开发包被锁解决方法
- Mysql与Oracle区别
- 使用DATABASE Log off收集oracle 等待事件信息