当前位置:网站首页>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)边栏推荐
- Get and set settings in 26class
- How does Guosen Securities open an account? Is it safe to open a stock account through the link
- Several key points in divorce agreement
- 14 MySQL tutorial insert insert data
- 新手炒股开户选哪个证券公司比较好?怎样炒股比较安全??
- LeetCode——226. 翻轉二叉樹(BFS)
- Knapsack problem with dependency
- The difference between round and truncate in SQL (round or truncate)
- Digital signature standard (DSS)
- Niuke network: Design LRU cache structure design LFU cache structure
猜你喜欢

Solve the problem that each letter occupies a space in pycharm

properties文件乱码

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

数字签名标准(DSS)

你了解如何比较两个对象吗

Ethereum技术架构介绍

Detailed explanation of asymmetric cryptosystem

解决pycharm里面每个字母占一格空格的问题

Class inheritance of 25class

DVD-数字通用光盘
随机推荐
博云,站在中国容器潮头
无需人工先验!港大&同济&LunarAI&旷视提出基于语义分组的自监督视觉表征学习,显著提升目标检测、实例分割和语义分割任务!
Introduction to Ethereum Technology Architecture
MySQL exports all table indexes in the database
Comp281 explanation
[QNX] Command
CD-CompactDisk
[buuctf.reverse] 126-130
#26class中get和set设置
Chen Qiang: Alibaba's 100 billion level large-scale digital business knowledge map helps business growth
(必须掌握的多线程知识点)认识线程,创建线程,使用Thread的常见方法及属性,以及线程的状态和状态转移的意义
Knapsack problem with dependency
在国金证券开户怎么样?开户安全吗?
Plt How to keep show() not closed
请指教同花顺开户选选择哪家券商比较好?现在在线开户安全么?
分页查询、JOIN关联查询优化
Preparing for the Blue Bridge Cup and ccf-csp
带你解决哈希冲突,并实现一个简单hash表,
Vscode usage - Remote SSH configuration description
VCD-影音光碟