Reprence Html CSS javascript PHP MySQL Bootsrap

MySQL RIGHT JOIN Keyword

The RIGHT JOIN keyword returns all records from the right table (table2), and the matching records (if any) from the left table (table1).

92

RIGHT JOIN Syntax

93

Demo Database

In this tutorial we will use the well-known Northwind sample database.

Below is a selection from the "Orders" table:

94

And a selection from the "Employees" table:

95

MySQL RIGHT JOIN Example

The following SQL statement will return all employees, and any orders they might have placed:


Note: The RIGHT JOIN keyword returns all records from the right table (Employees), even if there are no matches in the left table (Orders).