Please explain MySQL Joins in simple language(请用简单的语言解释 MySQL Joins)
问题描述
请用简单的语言向我解释加入.请不要发布网络链接,因为我需要阅读开发人员而非作者的理解方式.
Please explain to me joins in simple language. Please do not post a web link as I need to read how a developer understand it, not an author.
推荐答案
我能指出的最好的是 SQL 连接的可视化说明.
Best I can point you to is A Visual Explanation of SQL Joins.
图表对我帮助很大.
在此处添加链接帖子中的主要图表.
Adding the main diagrams from the linked post here.
内连接只生成在表 A 和表 B 中都匹配的记录集.
Inner join produces only the set of records that match in both Table A and Table B.
全外连接
全外连接生成表 A 和表 B 中所有记录的集合,并在可用的情况下从双方匹配记录.如果不匹配,则缺失的一侧将包含 null.
Full outer join produces the set of all records in Table A and Table B, with matching records from both sides where available. If there is no match, the missing side will contain null.
左外连接
左外连接从表 A 中生成一组完整的记录,匹配的记录(如果可用)在表 B 中.如果没有匹配,右侧将包含空值.
Left outer join produces a complete set of records from Table A, with the matching records (where available) in Table B. If there is no match, the right side will contain null.
这篇关于请用简单的语言解释 MySQL Joins的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:请用简单的语言解释 MySQL Joins
基础教程推荐
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 无法解决整理冲突 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
