Home >Database >Mysql Tutorial >What does left join mean?
The left join keyword returns all rows from the left table, even if there is no match in the right table. If there is no match in the right table, the result is NULL. The specific syntax is: [select column from t1 left join t2 on t1.column=t2.column].
left join keyword
(recommended learning: mysql tutorial)
The LEFT JOIN keyword returns all rows from the left table (table1) even if there is no match in the right table (table2). If there is no match in the right table, the result is NULL.
LEFT JOIN keyword syntax
SELECT column_name(s) FROM table_name1 LEFT JOIN table_name2 ON table_name1.column_name=table_name2.column_name
Note: In some databases, LEFT JOIN is called LEFT OUTER JOIN.
Let’s look at a picture:
Note: The LEFT JOIN keyword returns all rows from the left table, even if the right table (access_log ) does not match.
The above is the detailed content of What does left join mean?. For more information, please follow other related articles on the PHP Chinese website!