Home  >  Article  >  Database  >  What does left join mean?

What does left join mean?

王林
王林Original
2020-06-28 13:59:1819126browse

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].

What does left join mean?

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:

What does left join mean?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn