MySQL RIGHT JOIN

Last Updated: March 13, 2022

MySQL RIGHt JOIN displays all the records from the right table and all matching records from the left table

Venn diagram for the RIGHT JOIN

right join

MySQL LEFT JOIN Syntax

SELECT column_name(s)
FROM table1
RIGHT JOIN table2
ON table1.column_name = table2.column_name;

Example

The following example shows you how to do LEFT JOIN with tableX and tableY

table join inner 1
Select  * from tableX 
RIGHT JOIN  tableY 
ON tableX.B= tableY.D

You can have the following result set for RIGHT JOIN

right join result
Test