Home >Database >SQL >What is the difference between sql left join and right join?

What is the difference between sql left join and right join?

烟雨青岚
烟雨青岚Original
2020-07-06 16:17:578553browse

The difference between sql left connection and right connection is: the left connection will read all the data in the data table on the left, even if there is no corresponding data in the data table on the right; and the right connection will read all the data in the data table on the right, even if the data on the left The data table has no corresponding data.

What is the difference between sql left join and right join?

Left JOIN:

Keyword: LEFT JOIN

Left table: books Right table: articles

What is the difference between sql left join and right join?

The left join will read all the data in the left data table, even if there is no corresponding data in the right data table. (If the data in the two tables has the same part, only one will be displayed)

What is the difference between sql left join and right join?

Right join:

Keywords: RIGHT JOIN

Left table: books Right table: articles

What is the difference between sql left join and right join?

The right join will read the data table on the right All data, even if there is no corresponding data in the data table on the left. (If the data in the two tables has the same part, only one will be displayed)

What is the difference between sql left join and right join?

Recommended tutorial: "sql video tutorial"

The above is the detailed content of What is the difference between sql left join and right join?. 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