Inner join(内连接):一种 SQL 连接方式,只返回两张(或多张)表中连接条件匹配成功的记录;不匹配的行会被丢弃。常用于按共同键(如 id)把相关数据合并在一张结果集中。(在 SQL 中通常直接写 JOIN 也默认表示 INNER JOIN。)
/ˈɪnər dʒɔɪn/
We use an inner join to match customers with their orders.
我们用内连接把客户与他们的订单匹配起来。
To analyze sales by region, the analyst wrote an inner join between the orders table and the stores table on store_id, filtering out records with missing matches.
为了按地区分析销量,分析师在 orders 表与 stores 表之间用 store_id 做了内连接,并过滤掉无法匹配的记录。
inner 意为“内部的、内侧的”,join 意为“连接、结合”。在关系型数据库语境中,inner join 表示“只取两边都对得上的那部分(交集)”的连接结果。join 作为“连接”的用法可追溯到古法语 joindre,源自拉丁语 jungere(意为“连接、结合”)。