当前位置:网站首页>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
边栏推荐
- dotnet OpenXML 解析 PPT 图表 面积图入门
- 第四章:redis 数组结构的set和一些通用命令「建议收藏」
- 正则表达式replaceFirst()方法具有什么功能呢?
- 告白数字化转型时代:麦聪软件以最简单的方式让企业把数据用起来
- STM32+ULN2003 drives 28BYJ4 stepper motor (forward and reverse according to the number of turns)
- 手写柯里化 - toString 理解
- 【综合类型第 35 篇】程序员的七夕浪漫时刻
- LeetCode 216. Combined Sum III (2022.08.04)
- 技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离
- 5.部署web项目到云服务器
猜你喜欢

首次去中心化抢劫?近2亿美元损失:跨链桥Nomad 被攻击事件分析

leetcode: 529. Minesweeper Game

技术干货 | 基于 MindSpore 实现图像分割之豪斯多夫距离

这份阿里强推的并发编程知识点笔记,将是你拿大厂offer的突破口

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

Complete image segmentation efficiently based on MindSpore and realize Dice!

Voice-based social software development - making the most of its value

Bias lock/light lock/heavy lock lock is healthier. How is locking and unlocking accomplished?

教你本地编译运行一个IDEA插件,在IDEA里聊天、下棋、斗地主!

Meteorological data processing example - matlab string cutting matching and R language date matching (data splicing)
随机推荐
【温度预警程序de开发】事件驱动模型实例运用
高质量 DeFi 应用构建指南,助力开发者玩转 DeFi Summer
Getting started with Polkadot parachain development, this article is enough
static linking and dynamic linking
JS逆向入门学习之回收商网,手机号码简易加密解析
SMB + SMB2: Accessing shares return an error after prolonged idle period
我们的Web3创业项目,黄了
three.js调试工具dat.gui使用
The JVM collection that Alibaba's top architects have summarized for many years, where can't I check it!
茄子科技CEO仇俊:以用户为中心,做用户真正需要的产品
The founder of the DFINITY Foundation talks about the ups and downs of the bear market, and where should DeFi projects go?
静态链接和动态链接
What is the function of the regular expression replaceAll() method?
第五章:多线程通信—wait和notify
韦东山 数码相框 项目学习(六)tslib的移植
Brief Analysis of WSGI Protocol
5. Deploy the web project to the cloud server
19. Server-side session technology Session
Introduction to SD NAND Flash!
Oracle 19.3 restart 环境