SQLite RIGHT JOIN Keyword
RIGHT JOIN
RIGHT JOIN returns all the records from the right table (table2), and the matching records from the left table (table1). When there is no match, the columns from the left table are NULL.

This example selects all the employees, and the orders they have handled:
Example
SELECT Orders.OrderID, Employees.LastName,
Employees.FirstName
FROM Orders
RIGHT JOIN Employees
ON Orders.EmployeeID = Employees.EmployeeID
ORDER BY Orders.OrderID;
Try it Yourself »
Note: RIGHT JOIN works in SQLite 3.39.0 and later. In older versions, swap the two tables and use LEFT JOIN. The result is the same.
The Same With LEFT JOIN
This query gives the same result, with the tables swapped and LEFT JOIN:
Example
SELECT Orders.OrderID, Employees.LastName,
Employees.FirstName
FROM Employees
LEFT JOIN Orders
ON Orders.EmployeeID = Employees.EmployeeID
ORDER BY Orders.OrderID;
Try it Yourself »