LEFT JOIN Keyword in SQL Server

LEFT JOIN Keyword in SQL Server

In this article, the SQL LEFT JOIN keyword returns all records from the left table (table1), and the matched records from the right table (table2). The result is NULL from the right side table, if there is no match

Syntax

The syntax of a LEFT JOIN is as follows:

SELECT table1.column1, table2.column2... FROM table1 LEFT JOIN table2 ON table1.common_id = table2.common_id
SELECT  ID, NAME, DATE, AMOUNT
   FROM CUSTOMER
   LEFT JOIN ORDER
   ON CUSTOMER.ID = ORDER.CUSTOMER_ID

2020-04-21