下图展示了 LEFT JOIN、RIGHT JOIN、INNER JOIN、OUTER JOIN 关联的 7 种用法。
详细分解如下:
1.INNER JOIN(内连接)SELECT <select_list> FROM Table_A AINNER JOIN Table_B BON A.Key = B.Key
2.LEFT JOIN(左连接)SELECT <select_list>FROM Table_A ALEFT JOIN Table_B BON A.Key = B.Key
3.RIGHT JOIN(右连接)SELECT <select_list>FROM Table_A ARIGHT JOIN Table_B BONA.Key = B.Key
4.OUTER JOIN(外连接)SELECT <select_list>FROM Table_A AFULL OUTER JOIN Table_B BON A.Key = B.Key
5.LEFT JOIN EXCLUDING INNER JOIN(左连接-内连接)SELECT<select_list>FROM Table_A ALEFT JOIN Table_B BON A.Key = B.KeyWHERE B.Key IS NULL
6.RIGHT JOIN EXCLUDING INNER JOIN(右连接-内连接)SELECT <select_list>FROM Table_A ARIGHT JOINTable_B BON A.Key = B.KeyWHERE A.Key IS NULL
7.OUTER JOIN EXCLUDING INNER JOIN(外连接-内连接)SELECT <select_list>FROM Table_A AFULL OUTER JOIN Table_B BONA.Key = B.KeyWHERE A.Key IS NULL OR B.Key IS NULL
源自:www.codeproject.com/Articles/33052
更加多优秀文案
1、微服务架构下网关的技术选型
2、吊打面试官,最平常的 SpringCloud 微服务面试题
3、设计一个容错的微服务架构
4、为何微服务必定要有网关?
5、主流微服务全链路监控系统之战
6、全面解析微服务系统监控分层,啃透服务治理核心!
7、设计一个容错的微服务架构
8、深挖,一文搞懂 Sentinel 限流熔断!
9、从零搭建 SpringCloud Alibaba 鉴权中心服务(仔细教程)
十、什么是脚手架?为何必须脚手架?常用的脚手架有那些?
11、行业驱动设计(DDD)的几种典型架构介绍
12、微服务网关鉴权:gateway运用、网关限流运用、用户秘码加密、JWT鉴权
13、Spring Cloud Sleuth 全链路日志跟踪处理方法(剧烈举荐)
14、SpringCloud整合Alibaba Seata实现分布式事务
如爱好本文,请点击右上角,把文案分享到伴侣圈
因公众号更改推送规则,请点“在看”并加“星标”第1时间获取精彩技术分享
·END·
|