当前位置:网站首页>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)
边栏推荐
- Properties file garbled
- wechat_ Solve the problem of page Jump and parameter transfer by navigator in wechat applet
- 股票开账户如何优惠开户?现在在线开户安全么?
- How about opening a flush account? Is it safe? How to open a stock trading account
- Let torch cuda. is_ Experience of available() changing from false to true
- Lm06 the mystery of constructing the bottom and top trading strategy only by trading volume
- 让torch.cuda.is_available()从false变成true的一点经验
- RuntimeError: CUDA error: out of memory自己的解决方法(情况比较特殊估计对大部分人不适用)
- 比较两个对象的大小关系原来可以如此花里胡哨
- 正则匹配相同字符
猜你喜欢
[code Capriccio - dynamic planning] t583. Deleting two strings
分页查询、JOIN关联查询优化
Tsinghua & Shangtang & Shanghai AI & CUHK proposed Siamese image modeling, which has both linear probing and intensive prediction performance!
CD-CompactDisk
Properties file garbled
Uncover the secret of Agora lipsync Technology: driving portraits to simulate human speech through real-time voice
Halcon's region: features of multiple regions (5)
Connected to surface test questions
[buuctf.reverse] 126-130
#26class中get和set设置
随机推荐
带你解决哈希冲突,并实现一个简单hash表,
No manual prior is required! HKU & Tongji & lunarai & Kuangshi proposed self supervised visual representation learning based on semantic grouping, which significantly improved the tasks of target dete
transforms.RandomCrop()的输入只能是PIL image 不能是tensor
CD-CompactDisk
小程序设置按钮分享功能
非对称密码体制详解
How about opening an account at Guojin securities? Is it safe to open an account?
博云,站在中国容器潮头
正则匹配相同字符
Uncover the secret of Agora lipsync Technology: driving portraits to simulate human speech through real-time voice
mysql Add column 失败 因为之前有数据,不是默认null 不行
Bayesian network explanation
Tencent qianzhiming: Exploration and application of pre training methods in information flow business
ISO文件
idea中文插件chinese(simplified) language pack
股票开账户如何优惠开户?现在在线开户安全么?
让torch.cuda.is_available()从false变成true的一点经验
你了解如何比较两个对象吗
Detailed explanation of dos and attack methods
Map和List<Map>转相应的对象