Oracle union intersect minus 复习
来源:互联网 发布:发膜一周用几次知乎 编辑:程序博客网 时间:2024/06/05 14:27
两个子查询进行集合运行, 条件就是两个查询的字段个数一致,类型一致,字段名可以不同。
SQL> select * from ta;
ID NAME
---------- --------------------
1 gorey
2 gorey2
SQL> select * from tb;
ID ADDRESS
---------- --------------------
2 g2
3 g3
2 gorey2
SQL> select * from ta union select * from tb;
ID NAME
---------- --------------------
1 gorey
2 g2
2 gorey2
3 g3
■union小结: 左集合+右集合, 但是有重复行的情况只显示一行。相当于有DISTINCT
SQL> select * from ta intersect select * from tb;
ID NAME
---------- --------------------
2 gorey2
■intersect 小结: 没有多话,取交集
SQL> select * from ta minus select * from tb;
ID NAME
---------- --------------------
1 gorey
■minus 小结: 左集 - 左右集的交集。
SQL> select * from ta union all select * from tb;
ID NAME
---------- --------------------
1 gorey
2 gorey2
2 g2
3 g3
2 gorey2
■union all 小结: 注意,这个和union 不同, all加上的话,意思是union里的重复行不省略。会全部显示。
- Oracle union intersect minus 复习
- oracle union intersect minus
- oracle MINUS INTERSECT UNION ALL
- Oracle中的Union、Union All、Intersect、Minus
- Oracle Union/Union All/Intersect/Minus区别
- Oracle中的Union、Union All、Intersect、Minus
- oracle union union all intersect minus
- Oracle中的Union、Union All、Intersect、Minus
- Oracle 中的Union、Union All、Intersect、Minus
- Oracle中的Union、Union All、Intersect、Minus
- oracle:union、union all、intersect、minus
- oracle union union all intersect minus
- Oracle中的Union、Union All、Intersect、Minus
- Oracle中的Union、Union All、Intersect、Minus
- Oracle中的Union、Union All、Intersect、Minus
- Oracle中的Union、Union All、Intersect、Minus
- Oracle中的Union、Union All、Intersect、Minus
- Oracle中的Union、Union All、Intersect、Minus
- 安装SqlServer2005时“版本变更检查 (警告)"问题排查
- 钟莉颖
- coolbar让你的delphi应用程序更酷
- VS2005 重置所有设置
- 细说 #pragma pack(n)
- Oracle union intersect minus 复习
- 转发和重定向的区别
- WINVNC(二)omni_thread
- JavaScript高级程序设计学习笔记1: 基础
- 总算结束了--TCC
- IT人士群聚喝酒的讲究
- Dom4j修改文件
- [转]Linux下的(主要是Ubuntu)快捷键
- Linux安装Mysql+Apach+PHP+phpMyAdmin