本文介绍了为什么这么称呼内部联接和外部联接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解内部和外部联接的工作方式.但是,在此上下文中,内部/外部"一词的含义是什么?内部联接到底是什么?什么是外部联接的外部联接?

I understand the working of inner and outer joins. But what is the meaning of the words inner / outer in this context? What is so inner about inner join? What is outer about outer join?

最好的问候,维沙尔

推荐答案

另一个观点:

最早的嵌套嵌套简单实现之一.

One of the earliest simple implementations for joins used nested loops.

  1. 对于内部联接,只要连接列匹配,外部循环将在任何关系上进行迭代,内部循环将在其他关系上进行迭代并创建复合行.因此,将在内部循环中创建并填充输出行.因此,这称为INNER JOIN.

  1. For inner join, the outer loop would iterate over any relation and the inner loop would iterate over the other relation and create composite rows whenever join columns matched. Thus the output rows get created and populated in the inner loop. Hence this is called INNER JOIN.

当我们希望保留左侧关系\表中的所有行时,外部循环将不得不在左侧表上进行迭代,并且不仅会在内部循环中为匹配的情况添加行,还会在行中添加行不匹配情况的外部循环(其中左表在右表中没有基于连接列的匹配行).在这种情况下,左表需要转到外循环,因此它被称为LEFT OUTER JOIN.

When we want all rows in left side relation\table to be retained, the outer loop will have to iterate on the left table and rows would be added not only in the inner loop for matching cases but also in the outer loop for non-matching cases(where left table doesn't have a matching row in right table based on join columns). In this case, the left table needs to go to the outer loop, so it is called LEFT OUTER JOIN.

当我们希望保留右侧关系\表中的所有行时,右侧表将需要进入外循环,因此称为RIGHT OUTER JOIN.

When we want all rows in right side relation\table to be retained, right table will need to go into outer loop, so it is called RIGHT OUTER JOIN.

当我们要保留两个表的不匹配行时,在最简单的方法中,我们将有两个嵌套循环.一个嵌套循环在外部循环中具有左表,而另一个嵌套循环在外部循环中具有右表.因此,两个表都进入外循环,因此被称为FULL OUTER JOIN.

When we want non matching rows of both tables to be retained, in the simplest approach, we would have two nested loops. One nested loop would have left table in the outer loop and the other nested loop would have right table in the outer loop. So both tables go to outer loop, hence it is called FULL OUTER JOIN.

将链接添加到有关嵌套循环实现的文章中: http://www.cs.berkeley.edu/~brewer/cs262/3-selinger79.pdf

Adding the link to the paper that talks about nested loop implementation : http://www.cs.berkeley.edu/~brewer/cs262/3-selinger79.pdf

这篇关于为什么这么称呼内部联接和外部联接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 10:39