zoukankan      html  css  js  c++  java
  • Database.SQL.join

    Join in SQL

    1. SQL Join Types

    Ref[2]

    1.1 Inner Joins 

    Inner joins return rows when the join condition is met.  This is the most common Database join. 

    A common scenario is to join the primary key of once table to the foreign key of another.

    1.2 Cross Joins

    Cross joins return all combinations of rows from each table.  So, if you’re looking to find

    all combinations of size and color, you would use a cross join.  

    Join conditions aren’t used with cross joins. It pure combinatory joy.

    1.3 Outer Joins

    Outer joins return all the rows from one table, and if the join condition is met, columns from the other.

    They differ from an inner join, since an inner join wouldn’t include the non-matching rows in the final result.

    There are three types of outer joins:  Left, Right, and Full outer joins.

    1.3.1 Left Outer Join

    Left Outer Join – Return all rows from the “left” table, and matching rows from the “right” table. 

    If there are no matches in the right table, return Null values for those columns.

    1.3.2 Right Outer Join

    Right Outer Join – Return all rows from the “right” table, and matching rows from the “left” table. 

    If there are no matches in the left table, return Null values for those columns.

    1.3.3 Full Join

    Full Join – Return all rows from an inner join, when no match is found, return nulls for that table.

    该解释需要"推敲"。

    2. Inner Join

    Ref[3]


    Reference

    1. inner join 和 outer join的区别

    http://en.wikipedia.org/wiki/Join_%28SQL%29

    2. Database Joins – Introduction to Join Types and Concepts

    https://www.essentialsql.com/introduction-database-joins/

    3. SQL Inner Join Tutorial

    https://www.essentialsql.com/sql-tutorial/sql-inner-join-tutorial/

    4. A SQL join on multiple tables: overview and implementation [To Debug]

    https://www.sqlshack.com/different-approaches-to-sql-join-multiple-tables/

    https://www.sqlshack.com/sql-multiple-joins-for-beginners-with-examples/

    5. How to Join on Multiple Columns

    https://learnsql.com/cookbook/how-to-join-on-multiple-columns/

    https://learnsql.com/cookbook/

    https://learnsql.com/blog/sql-joins-types-explained/

    6. What are the different types of SQL JOIN clauses?

    https://medium.com/swlh/what-are-the-different-types-of-sql-join-clauses-20f7564b25cb

    7. Understanding SQL Joins – All You Need To Know About SQL Joins

    https://www.edureka.co/blog/sql-joins-types

    8. SQL Joins Explained

    http://www.sql-join.com/sql-join-types

    ---
  • 相关阅读:
    Objective-C之Protocol
    Objective-C之集合对象的内存管理
    IOS的UI基础02
    IOS之UIImageView--小实例项目--带音效的拳皇动画
    IOS的UI基础01
    技术分享(持续更新)
    计算机英语词汇大全
    XCode的安装包校验伪真
    Objective-C之用C的字符来处理NSString相关的字符替换和拼接的问题
    Objective-C之代理设计模式小实例
  • 原文地址:https://www.cnblogs.com/cwgk/p/3812712.html
Copyright © 2011-2022 走看看