right join(SQL 术语):右连接/右外连接。在连接两张表时,返回右表(right table)中的所有行,并匹配左表中满足连接条件的行;若左表无匹配,则左表对应列为 NULL。(常见同义写法:RIGHT OUTER JOIN)
/raɪt dʒɔɪn/
A right join keeps all rows from the right table, even when there is no match.
右连接会保留右表的所有行,即使没有匹配记录也会保留。
We used a right join to include every invoice, attaching customer data when available and leaving missing customers as NULL.
我们用右连接来确保每一张发票都被包含在结果中;能匹配到客户信息就附上,匹配不到的客户字段则显示为 NULL。
right 在这里指“右侧/右表”(即在 RIGHT JOIN 语句中写在连接关键字右边的那张表),强调“以右表为主”。join 来自动词“连接、结合”,源自古法语 joindre(连接),更早可追溯到拉丁语 iungere(连接、结合)。合起来就形成了“以右表为保留对象的连接方式”。