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

    ---
  • 相关阅读:
    解决安装python3后yum不能使用情况
    一文教您如何通过 Docker 快速搭建各种测试环境(Mysql, Redis, Elasticsearch, MongoDB
    nginx 的基本配置与虚拟主机配置
    /etc/nginx/nginx.conf配置文件详解
    简单使用ab命令压力测试
    死锁和死锁检测
    centos7下搭建消息中间件--RocketMQ
    Centos7.2配置https
    Mysql 通过binlog日志恢复数据
    MySQL主从复制+备份
  • 原文地址:https://www.cnblogs.com/cwgk/p/3812712.html
Copyright © 2011-2022 走看看