反连接和反半连接有什么区别? [英] what is the difference between an anti-join and an anti semi join?

查看:564
本文介绍了反连接和反半连接有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自 http://www.dbspecialists.com/files/presentations/semijoins. html

两个表之间的反联接"返回第一个表中的行 在第二张表中找不到匹配项.一个反联接是 本质上与半联接相反:半联接返回一个 第一个表中至少有一个匹配项的每一行的副本 发现,反联接返回第一个表中每行的一个副本 找不到匹配项.

An "anti-join" between two tables returns rows from the first table where no matches are found in the second table. An anti-join is essentially the opposite of a semi-join: While a semi-join returns one copy of each row in the first table for which at least one match is found, an anti-join returns one copy of each row in the first table for which no match is found.

返回未找到匹配项的第一张表中的每一行的一个副本"不是反半联接而不是反联接吗?

Isn't an anti semi-join instead of an anti-join the one which "returns one copy of each row in the first table for which no match is found"?

如果是,反联接的定义是什么?

If it is, what is the definition of an anti-join?

请注意,我的问题是在SQL的一般级别上,例如在有关数据库概念的大学教科书级别上,而不是特定于特定的SQL RDBMS实现

Note that my question is at the general level of SQL, such as at the level of college text books on database concepts, not specific to a particular SQL RDBMS implementation

谢谢.

推荐答案

反半联接是反联接.

反连接也可以定义为半连接的补码,如下所示:

The antijoin can also be defined as the complement of the semijoin, as follows:

R▷S = R − R⋉S

R ▷ S = R − R ⋉ S

鉴于此,antijoin有时被称为anti-semijoin,antijoin运算符有时被写成半联接符号,并在其上方有一个条形,而不是▷.

Given this, the antijoin is sometimes called the anti-semijoin, and the antijoin operator is sometimes written as semijoin symbol with a bar above it, instead of ▷.

请参见 https://en.wikipedia. org/wiki/Relational_algebra#Antijoin_.28.E2.96.B7.29

这篇关于反连接和反半连接有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆