|
Suppose you have two tables named T1 and T2, which are called the left table and the right table respectively.
The FULL OUTER JOIN of the T1 and T2 returns a result set which includes rows from both left and right tables.
When no matching rows exist for the row from the left table, the columns of the right table are filled with NULL.
Similarly, when no matching rows exist for the row from the right table, the columns of the left table will be filled with NULL.
Returns all rows when there is a match in either left table or right table
Suponha que você tenha duas tabelas chamadas T1e T2, que são chamadas de tabela da esquerda e tabela da direita, respectivamente.
O FULL OUTER JOIN de T1 e T2 retorna um conjunto de resultados que inclui linhas das tabelas esquerda e direita.
Quando nenhuma linha correspondente existe para a linha da tabela à esquerda, as colunas da tabela à direita são preenchidas com NULL.
Da mesma forma, quando nenhuma linha correspondente existir para a linha da tabela da direita, as colunas da tabela da esquerda serão preenchidas com NULL.
Retorna todas as linhas quando há uma correspondência na tabela da esquerda ou na tabela da direita
The following SQL statement selects all customers, and all orders:
A seguinte instrução SQL seleciona todos os CustomerName e todos os OrderID:
SELECT Customers.CustomerName
, Orders.OrderID
FROM Customers
FULL OUTER JOIN Orders ON Customers.CustomerID = Orders.CustomerID
ORDER BY Customers.CustomerName;
|
|