Decode Analytics

View Original

Right Join

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

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

SQL RIGHT JOIN Syntax:

SELECT column_name(s)

FROM table1

RIGHT JOIN table2

ON table1.column_name = table2.column_name;

Example:

Lets use the “Orders” and “Products” tables to select all products with 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