SQL的EQUI JOIN【join和left join区别】

EQUI JOIN
这是一种最普通的 JOIN 操作,它包含两种连接方式:

INNER JOIN(或者是 JOIN )
OUTER JOIN(包括: LEFT 、 RIGHT、 FULL OUTER JOIN)

用例子最容易说明其中区别:

-- This table reference contains authors and their books.#这是一个表格包含作者和他们的书籍。
-- There is one record for each book and its author.#这是一条记录关于每个书籍和作者。
-- authors without books are NOT included#没有书的作者不包含在内。
author JOIN book ON author.id = book.author_id
book为主,有book的author包含在内。

-- This table reference contains authors and their books
-- There is one record for each book and its author.
-- ... OR there is an "empty" record for authors without books #没有book的作者的book的那一栏是空
-- ("empty" meaning that all book columns are NULL)
author LEFT OUTER JOIN book ON author.id = book.author_id
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值