Italian Trulli

Right Outer Joins in SQL With Example - Right Joins

Test Tribe

Right Joins in SQL - Right Outer Joins in SQL with Example 

In SQL, right joins are performed using the RIGHT JOIN or RIGHT OUTER JOIN keywords, depending on the database system you are using. The right join retrieves all records from the right (second) table and the matching records from the left (first) table.

Syntax of Right Out Joins 
Basic syntax of right join is given below.
SELECT columns
FROM table1
RIGHT JOIN table2 ON join_condition;

SELECT columns
FROM table1
RIGHT OUTER JOIN table2 ON join_condition;

Example of Right Outer Joins 
Example of right joins is given below.
SELECT Customers.ID, Customers.Name, Orders.Product
FROM Customers
RIGHT JOIN Orders ON Customers.ID = Orders.ID;

Right Outer Joins

Post a Comment