Computer Science/Database

W3Schools SQL | #23 SQL FULL OUTER JOIN 키워드

토마토. 2022. 10. 28. 12:38

SQL FULL OUTER JOIN Keyword

SQL FULL OUTER JOIN Keyword

일단 왼쪽 테이블, 오른쪽 테이블을 모두 리턴하되,
일치하는 값이 없으면 null인 그대로 둔다.

SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name = table2.column_name
WHERE condition;

SQL FULL OUTER JOIN Example

SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
FULL OUTER JOIN Orders ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;