1. Example table A, Dept Department table
B. Employee table
Deptno corresponds to Dept.id to indicate the department number.
2. LEFT JOIN keyword
Left JOIN
Defined
On the basis of internal connections (e.g.),
Adds the result of the left table's non-conformance to the result set. (Non-conforming results, "Administration Department"). The Right table column is filled with null.
3, right connection. The statement keyword.
Right JOIN
Minor changes
As previously defined, the employee table has a corresponding department, then the right join result is the same as the inner join result. Therefore, an employee record is added. (number 4th)
Employee table, now:
Defined
On the basis of internal connections (e.g.),
Adds the result of the right table's non-conformance to the result set. (Non-conforming results, "employee number 4th"). The left table column is filled with null.
4. Full external connection
Statement keyword
Full JOIN
MySQL is not supported.
Definition: The basis of the inner connection. The non-conforming results of the left and right tables are added to the result set, and the table with NULL is filled in with nulls.
So, MySQL can be implemented with union.
Then look back and compare the left and right connections.
SQL outer JOIN