
.
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 columnsFROM table1RIGHT JOIN table2 ON join_condition;
SELECT columnsFROM table1RIGHT OUTER JOIN table2 ON join_condition;
Example of Right Outer Joins
Example of right joins is given below.
SELECT Customers.ID, Customers.Name, Orders.ProductFROM CustomersRIGHT JOIN Orders ON Customers.ID = Orders.ID;
![]() |
Right Outer Joins |
0 Comments