当前位置:网站首页>SQL外连接之交集、并集、差集查询
SQL外连接之交集、并集、差集查询
2022-08-05 10:10:00 【且行且安~】
接上一小节的内容,重点讲述了外连接的类型,外连接的语法结构,本小节将会在外连接的基础上,重点阐述下交集、并集、差集查询。
1、交集
交集的示意图如下:

语法结构为:
A、B的交集: select * from A inner jion B on A.col = B.col
2、差集
差集在工作中,可能使用的场景会较多一些。
A相对于B的差集,示意图如下:

差集的语法结构如下:
A相对于B 的差集:select * from A LEFT join B on A.col = B.col where B.col is null
3、并集
并集的示意图如下:

并集的语法结构如下:
A、B的并集:select*from A full outer join B on A.col = B.col
边栏推荐
- Oracle temporary table space role
- 你最隐秘的性格在哪?
- Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
- What is the function of the regular expression replaceFirst() method?
- Open Source Summer | How OpenHarmony Query Device Type (eTS)
- 一文道清什么是SPL
- 电竞、便捷、高效、安全,盘点OriginOS功能的关键词
- Where is your most secretive personality?
- What is CRM Decision Analysis Management?
- DFINITY 基金会创始人谈熊市沉浮,DeFi 项目该何去何从
猜你喜欢

华为轻量级神经网络架构GhostNet再升级,GPU上大显身手的G-GhostNet(IJCV22)

Technical dry goods | Hausdorff distance for image segmentation based on MindSpore

JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number

多线程(进阶) - 2.5w字总结

哪位大佬有20年4月或者1月的11G GI和ojvm补丁呀,帮忙发下?

Our Web3 Entrepreneurship Project, Yellow

Getting started with Polkadot parachain development, this article is enough

Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)

语音社交软件开发——充分发挥其价值

【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different
随机推荐
uniapp connect ibeacon
5.部署web项目到云服务器
SMB + SMB2: Accessing shares return an error after prolonged idle period
LeetCode 216. Combined Sum III (2022.08.04)
浅析WSGI协议
教你本地编译运行一个IDEA插件,在IDEA里聊天、下棋、斗地主!
皕杰报表的下拉框联动
使用工具类把对象中的null值转换为空字符串(集合也可以使用)
告白数字化转型时代:麦聪软件以最简单的方式让企业把数据用起来
高质量 DeFi 应用构建指南,助力开发者玩转 DeFi Summer
2022 Huashu Cup Mathematical Modeling Ideas Analysis and Exchange
IO流篇 -- 基于io流实现文件夹拷贝(拷贝子文件夹及子文件夹内文件)满满的干货
dotnet OpenXML 解析 PPT 图表 面积图入门
IDEA执行Test操作导致数据插入时出现了重复数据
The century-old Nordic luxury home appliance brand ASKO smart wine cabinet in the three-temperature area presents the Chinese Valentine’s Day, and tastes the love of the delicacy
为什么sys_class 里显示的很多表的 RELTABLESPACE 值为 0 ?
JS introduction to reverse the recycling business network of learning, simple encryption mobile phone number
What is SPL?
第四章:activiti流程中,变量的传递和获取流程变量 ,设置和获取多个流程变量,设置和获取局部流程变量「建议收藏」
MySQL事务