English 中文(简体)
SQL Tutorial

5. 图瓦卢

Selected Reading

∗ E/CN.6/2009/1。
  • 时间:2024-12-27

Left Join vs Right Join


Previous Page Next Page  

左丁和儒昂权利之间的主要差别可以用表格的填写方式来观察。

它们是两种外表的同仁;即,他们保留一个桌子上的不配子,抛弃另一个桌子。 离开Join保留了左桌子的不配子,而权利组织则保留了右桌上的不配子。

Working of Left Join

<Left JoinLeft Outer Join>在表格中合并了两个或两个以上表格,其中第一个表格全部退还;但只有表上对口的记录才从相应的表格中收回。

如果在随后的表格中将0(zero)记录与第一桌的行数相匹配,那么,如果加入的话,则仍然会把第一张表格中的这些段次退回,但从右桌的每个栏目中再接下去。

Syntax

下面是Joinkou的基本yn子——

SELECT table1.column1, table2.column2...
FROM table1
LEFT JOIN table2
ON table1.column_name = table2.column_name;

Example

下面的例子表明,左边在两个相对表格上运行。 第一个表载有工资信息,而第二个表则载有婚姻状况信息。 由于Alex的地位问题不为人所知,因此没有列入表格。

Left Join Vs Right Join

如果两个表格都使用左边询问,因为没有记录对Alex的对应地位,则该数值在最后表格中记录为NUL。

Working of Right Join

Join 或Liber Outer Join query在右桌上返回了所有各行,即使左桌上没有配对。 这意味着,如果《国家公报》条款将左表上的0(0o)记录与右表上的记录相匹配;右边将依次退还右表的几行,但左边的每个栏中都带有民族解放军的价值。

Syntax

Following is the basic syntax of a Right Join in SQL −

SELECT table1.column1, table2.column2...
FROM table1
RIGHT JOIN table2
ON table1.column_name = table2.column_name;

Example

现在就在这种例子中,让我们努力在相同的表格上开展“权利参与”行动。 这里,我们开始从右桌上加入;因为右桌上没有记录比列亚历克的行价,最后表格中就没有记分。

Left Join Vs Right Join

The final table only consists of two rows as the right table consists of two rows only.

Left Join Vs Right Join

让我们总结一下以下表格中Join和Join权利之间的所有差异:

Left Join Right Join
Left Join matches the data of the first table or the left table with the data in second table. If the data is matched, the records are combined; otherwise, NULL is recorded.Right Join matches the data of the second table or right table with the data in first table. If the data is matched, the records are combined; otherwise, NULL is recorded.
If the first table has less rows than the second table, extra unmatched rows from the second table are discarded. If the second table has less rows than the first table, extra unmatched rows from the first table are discarded.
This Join is also known as Left Outer Join This Join is also known as Right Outer Join
*= is used in Transact SQL, instead of using the LEFT JOIN or LEFT OUTER JOIN query. =* is used in Transact SQL, instead of using the RIGHT JOIN or RIGHT OUTER JOIN query.

我们可以从总结中看到,左派和右派之间不存在广泛的差异。 两者之间的每一区别都与表格的合并方式和合并观点相差。

Advertisements