Trafodion 操作结果集-并集、差集、交集
来源:互联网 发布:dos java 编辑:程序博客网 时间:2024/05/22 03:30
前几天社区有同学问到Trafodion是否支持操作结果集,答案是:支持!
Trafodion与很多其他关系型数据库一样,可以支持两个结果集的并集、差集、交集操作。语法如下,
//并集query-expr UNION [ALL] query-primary//交集query-expr INTERSECT query-primary//差集query-expr EXCEPT query-primary
下面我们一起在Trafodion中试验一下吧,假设有两个表t1,t2,内容如下
SQL>select * from t1;A----------- 1 2 3--- 3 row(s) selected.SQL>select * from t2;A----------- 1 2--- 2 row(s) selected.
1 并集-union [all],其中union具体排序去重的作用,而union all只是简单的合并
SQL>select a from t1 union select * from t2;A----------- 1 2 3--- 3 row(s) selected.SQL>select a from t1 union all select * from t2;A----------- 1 1 2 2 3--- 5 row(s) selected.
2 交集 –intersect
SQL>select a from t1 intersect select a from t2;A----------- 1 2--- 2 row(s) selected.
3 差集–except
SQL>select a from t1 except select a from t2;A----------- 3--- 1 row(s) selected.
阅读全文
1 0
- Trafodion 操作结果集-并集、差集、交集
- SQL 操作结果集 -并集、差集、交集、结果集排序
- SQL 操作结果集 -并集、差集、交集、结果集排序
- SQL 操作结果集 -并集、差集、交集、结果集排序
- SQL 操作结果集 -并集、差集、交集、结果集排序
- SQL操作结果集-并集,差集,交集,结果集排序
- SQL 操作结果集 -并集、差集、交集、结果集排序
- SQL 操作结果集 -并集、差集、交集、结果集排序
- SQL 操作结果集 -并集、差集、交集、结果集排序
- SQL 操作结果集 -并集、差集、交集、结果集排序
- SQL 操作结果集 -并集、差集、交集、结果集排序
- SQL 操作结果集 -并集、差集、交集、结果集排序
- ORACLE 数据查询集合即:查询结果的集合操作 并集 交集 差集
- SQL 并集、差集、交集、结果集排序
- 交集 并集 差集
- 交集差集并集
- 集合类(并集、交集、差集操作)
- ES6 操作数组的并集/交集/差集
- spring boot集成mybatis
- week_10_ ZigZag Conversion
- ubus实现进程间通信举例
- 深度学习资料汇总
- 软件调试笔记15
- Trafodion 操作结果集-并集、差集、交集
- Android架构组件之ViewModel
- tomcat-自带的简单session共享,小集群适用
- newCoder Wannafly挑战赛4:A 解方程
- Git版本控制常见操作
- Discovering the Local Time Zone: Why It's a Hard Problem Article of General Interest to the Smallta
- 彻底解决wordpress安装主题或插件需要FTP问题
- spring+springmvc+jpa+thymeleaf 练习
- android 颜色选择控件、等待动画、图片高斯模糊等源码