Please explain MySQL Joins in simple language

前端 未结 3 1653
孤街浪徒
孤街浪徒 2020-12-06 08:20

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.

3条回答
  •  执念已碎
    2020-12-06 08:42

    Best I can point you to is A Visual Explanation of SQL Joins.

    The diagrams helped me a lot.


    Adding the main diagrams from the linked post here.

    Inner Join

    inner join diagram

    Inner join produces only the set of records that match in both Table A and Table B.

    Full outer join

    full outer join diagram

    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.

    Left outer join

    left outer join diagram

    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.

提交回复
热议问题