当前位置:网站首页>Union, intersection and difference operations in SQL
Union, intersection and difference operations in SQL
2022-06-26 18:15:00 【yanruo06280】
SQL It's not the same in China 、 hand over 、 Difference operation
1、 hand over ( Corresponding to the intersection operation in the set ,A∩B)
notes : Returns the same part of the query result, that is, their intersection , Want to keep all duplicates , Must use INTERSECT ALL Instead of INTERSECT
(select * from table1) intersect (select * from table2)
2、 Difference set ( Corresponding to the difference set operation in the set ,A-B)
notes : Return the row records that are different from the second query result in the first query result ,
That is, the difference set of two results ,EXCEPT The operation automatically removes duplicates , If you want to keep all the repetitions , Must use EXCEPT ALL Instead of EXCEPT..oracle of use minus Realization
(select * from table1) except(select * from table2)
3、 Combine ( Corresponding to the union operation in the set ,AUB)
notes :UNION The operation automatically removes duplicates , Want to keep all duplicates , You have to use UNION ALL Instead of UNION
(select * from table1) union(select * from table2)
边栏推荐
- Chinese (Simplified) language pack
- Data Encryption Standard DES security
- RSA concept explanation and tool recommendation - LMN
- 深入理解MySQL锁与事务隔离级别
- RSA加密解密详解
- Introduction to Ethereum Technology Architecture
- Several delete operations in SQL
- Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems
- transforms.RandomCrop()的输入只能是PIL image 不能是tensor
- Static registration and dynamic registration of JNI
猜你喜欢
ISO文件
Detailed explanation of dos and attack methods
博云,站在中国容器潮头
Deep understanding of MySQL lock and transaction isolation level
Take you to resolve hash conflicts and implement a simple hash table,
RuntimeError: CUDA error: out of memory自己的解决方法(情况比较特殊估计对大部分人不适用)
Do you know how to compare two objects
非对称密码体制详解
Lm06 the mystery of constructing the bottom and top trading strategy only by trading volume
Get and set settings in 26class
随机推荐
解决pycharm里面每个字母占一格空格的问题
数字签名标准(DSS)
17.13 补充知识、线程池浅谈、数量谈、总结
RSA concept explanation and tool recommendation - LMN
Map and list < map > transfer to corresponding objects
DoS及攻击方法详解
Concept and working principle of data encryption standard (DES)
Deep understanding of MySQL lock and transaction isolation level
Several delete operations in SQL
几种常见的UML关系图汇总
基于tensorflow的手写数字识别
非对称密码体制详解
请指教同花顺开户选选择哪家券商比较好?现在在线开户安全么?
JVM入个门(1)
Soft test preparation multimedia system
Introduction to Ethereum Technology Architecture
Handwritten promise all
深度学习之Numpy篇
JS common regular expressions
(multi threading knowledge points that must be mastered) understand threads, create threads, common methods and properties of using threads, and the meaning of thread state and state transition