当前位置:网站首页>SQL中的并、交、差运算
SQL中的并、交、差运算
2022-06-26 18:07:00 【yanruo06280】
SQL中的并、交、差运算
1、交(对应于集合中的交集操作,A∩B)
注:返回查询结果中相同的部分既他们的交集,想保留所有的重复,必须用INTERSECT ALL代替INTERSECT
(select * from table1) intersect (select * from table2)2、差集(对应于集合中的差集操作,A-B)
注:返回在第一个查询结果中与第二个查询结果不相同的那部分行记录,
即两个结果的差集,EXCEPT运算自动去除重复,如果想保留所有的重复,必须用EXCEPT ALL代替EXCEPT。。oracle中用minus实现
(select * from table1) except(select * from table2)3、并集(对应于集合中的并集操作,AUB)
注:UNION运算自动去除重复,想保留所有的重复,则必须用UNION ALL代替UNION
(select * from table1) union(select * from table2)边栏推荐
- MySQL download and configuration MySQL remote control
- Chinese (Simplified) language pack
- Runtimeerror: CUDA error: out of memory own solution (it is estimated that it is not applicable to most people in special circumstances)
- VCD-影音光碟
- Detailed explanation of MySQL mvcc mechanism
- How pycharm modifies multiline annotation shortcuts
- Ethereum技术架构介绍
- 正则匹配相同字符
- Which securities company is better for a novice to open a stock trading account? How is it safer to speculate in stocks??
- How about opening a flush account? Is it safe? How to open a stock trading account
猜你喜欢

Tsinghua & Shangtang & Shanghai AI & CUHK proposed Siamese image modeling, which has both linear probing and intensive prediction performance!

Chinese (Simplified) language pack

背包问题求方案数

MySQL download and configuration MySQL remote control

Ethereum技术架构介绍

Paging query and join Association query optimization

二分查找-2

padding百分比操作

Applet setting button sharing function
![[buuctf.reverse] 126-130](/img/df/e35633d85caeff1dece62a66cb7804.png)
[buuctf.reverse] 126-130
随机推荐
Ethereum技术架构介绍
js强制转换
Several key points in divorce agreement
Plt How to keep show() not closed
MySQL exports all table indexes in the database
Which securities company is better for a novice to open a stock trading account? How is it safer to speculate in stocks??
transforms.RandomCrop()的输入只能是PIL image 不能是tensor
如何将应用加入到deviceidle 白名单?
MySQL add column failed because there was data before, not null by default
padding百分比操作
pycharm的plt.show()如何保持不关闭
next(iter(dataloader))的一点点体会
MySql 导出数据库中的全部表索引
Padding percentage operation
tag动态规划-刷题预备知识-2. 0-1背包理论基础和二维数组解法模板
深入理解MySQL锁与事务隔离级别
输入n个整数,输出出现次数大于等于数组长度一半的数
决策树与随机森林
KDD 2022 | 如何在跨域推荐中使用对比学习?
pycharm如何修改多行注释快捷键