请用简单的语言解释MySQL Joins [英] Please explain MySQL Joins in simple language
问题描述
请以简单语言向我解释加入.请不要发布网络链接,因为我需要阅读开发人员而不是作者的理解.
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.
推荐答案
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中所有记录的集合,并在可用的情况下从两侧匹配记录.如果没有匹配项,则缺少的一面将为空.
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中具有匹配的记录(如果有).如果不匹配,则右侧将包含null.
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!