Decode Analytics

View Original

Left Join

LEFT JOIN performs a join starting with the first (before join operation) table and then any matching second (after join operation) table records.

The result is NULL in the right side when there is no match.

SQL LEFT JOIN Syntax:

SELECT column_name(s)

FROM table1

LEFT JOIN table2

ON table1.column_name = table2.column_name;

Example:

Lets use the “Order” and the “Customers” tables to find all of the customer names related to the Orders.

See this content in the original post

Results:

See this content in the original post

SQL Tutorial

See this content in the original post