MySQL LEFT JOIN

Last Updated: March 13, 2022

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

Venn diagram for the LEFT JOIN

left join venn

MySQL LEFT JOIN Syntax

SELECT column_name(s)
FROM table1
LEFT 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
Select  * from tableX 
LEFT JOIN  tableY 
ON tableX.B= tableY.D
left join results

First row is the matching row and other rows are from the LEFT table

Test