当前位置:网站首页>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
边栏推荐
- matcher中find,matches,lookingAt匹配字符串的不同之处说明
- 茄子科技CEO仇俊:以用户为中心,做用户真正需要的产品
- Imitation SBUS fixed with serial data conversion
- 教你本地编译运行一个IDEA插件,在IDEA里聊天、下棋、斗地主!
- dotnet OpenXML parsing PPT charts Getting started with area charts
- 第九章:activit内置用户组设计与组任务分配和IdentityService接口的使用
- What is SPL?
- 微服务 技术栈
- 2022华数杯数学建模A题环形振荡器的优化设计思路思路代码分享
- Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
猜你喜欢
STM32+ULN2003驱动28BYJ4步进电机(根据圈数正转、反转)
Getting started with Polkadot parachain development, this article is enough
产品太多了,如何实现一次登录多产品互通?
【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different
电竞、便捷、高效、安全,盘点OriginOS功能的关键词
什么是CRM决策分析管理?
Pytorch Deep Learning Quick Start Tutorial -- Mound Tutorial Notes (3)
七夕浪漫约会不加班,RPA机器人帮你搞定工作
Complete image segmentation efficiently based on MindSpore and realize Dice!
three.js debugging tool dat.gui use
随机推荐
正则表达式replaceAll()方法具有什么功能呢?
为什么sys_class 里显示的很多表的 RELTABLESPACE 值为 0 ?
华为轻量级神经网络架构GhostNet再升级,GPU上大显身手的G-GhostNet(IJCV22)
告白数字化转型时代:麦聪软件以最简单的方式让企业把数据用起来
第五章:activiti流程分流判断,判断走不同的任务节点
leetcode: 529. 扫雷游戏
【MindSpore Easy-Diantong Robot-01】You may have seen many knowledge quiz robots, but this one is a bit different
第四章:redis 数组结构的set和一些通用命令「建议收藏」
5. Deploy the web project to the cloud server
第六章:activiti流程分流判断之排它网关和并行网关
[Strong Net Cup 2022] WP-UM
High-quality DeFi application building guide to help developers enjoy DeFi Summer
Custom filters and interceptors implement ThreadLocal thread closure
Oracle临时表空间作用
three objects are arranged in a spherical shape around the circumference
PHP 操作mangoDb
STM32+ULN2003 drives 28BYJ4 stepper motor (forward and reverse according to the number of turns)
MySQL使用聚合函数可以不搭配GROUP BY分组吗?
【 temperature warning program DE development 】 event driven model instance
【温度预警程序de开发】事件驱动模型实例运用