mysql Chinese and foreign joins can be divided into left outer joins and right outer joins. The writing methods are "SELECT field name FROM table 1 LEFT OUTER JOIN table 2 ON clause" and "SELECT field name FROM table 1 RIGHT OUTER JOIN" Table 2 ON clause".
(Recommended tutorial: mysql video tutorial)
Outer joins can be divided into left outer joins and right outer joins
Left outer join: Contains all rows in the left table (regardless of whether there are matching rows in the right table), and all matching rows in the right table
Right outer join: Contains all rows in the right table (regardless of whether there are matching rows in the left table), and all matching rows in the left table
Left join
Left outer join, also known as left join, uses the LEFT OUTER JOIN keyword to connect two tables, and uses the ON clause to set the connection condition.
The syntax format of left join is as follows:
SELECT <字段名> FROM <表1> LEFT OUTER JOIN <表2> <ON子句>
The syntax description is as follows:
Field name : The name of the field to be queried.