当前位置:网站首页>Mysql seven connection query methods
Mysql seven connection query methods
2022-08-09 14:18:00 【Pastoral】
Mysql的七种join查询方法
Take out for everybody easy to use code alone
左连接 查a表独有和bThere are some table
select * from a left join b on a.key=b.key;
右连接 查b表独有和aThere are some table
select * from a right join b on a.key=b.key;
内连接 查a、b共有部分
select * from a inner join b on a.key=b.key;
只查a独有的部分
select * from a left join b on a.key=b.key where b.key is null;
只查b独有的部分
select * from a right join b on a.key=b.key where a.key is null;
全连接
select * from a left join b on a.key=b.key union select * from a right join b on a.key=b.key;
查a、b共有的部分
select * from a left join b on a.key=b.key where b.key is null union select * from a right join b on a.key=b.key where a.key is null;
oracle In the whole connection and thea、b共有部分
select * from a full outer join b on a.key=b.key
select * from a full outer join b on a.key=b.key where a.key is null or b.key is null
边栏推荐
猜你喜欢
随机推荐
pytest 之 fixture的定义及作用域
易语言获取cookie
音视频录入的pts和dts问题
Sql之各种Join
FFmpeg multimedia file processing (ffmpeg prints audio and video Meta information)
WPF 系统托盘 图标闪烁
关于做2D游戏时,Canvas边界显示在Game窗口的问题
pyhook3简单应用(1)--实现截图保存功能
面试攻略系列(二)-- 秒杀系统
数据增广
32位机器和64位机器基本数据类型长度
学习opencv-基础应用
C#使用cersharp
什么是布隆过滤器?如何使用?
记一次 ERROR scheduler.AsyncEventQueue: Dropping event from queue shared导致OOM
NC40 链表相加(二)
Realization of RTSP Protocol
机器学习web服务化实战:一次吐血的服务化之路 (转载非原创)
NC84 完全二叉树结点数
pytest 筛选用例