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.
Left JOIN:
Keyword: LEFT JOIN
Left table: books Right table: articles
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)
Right join:
Keywords: RIGHT JOIN
Left table: books Right table: articles
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)
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!