1. Internal connection:
INNER join, Crross Join,join is an equivalent connection in MySQL that produces a Cartesian product.
The join operator "," (comma) is similar, but the precedence of the comma operator differs from the other connection types. Sometimes, when other connection types are normal, it causes syntax errors, so it is recommended to avoid using the comma operator as much as possible
Other syntax formats: Use the ON clause instead of the WHERE clause. Example: SELECT t1.*,t.* from t1 INNER JOIN t2 on t1.i1 = T2.i2
Use the using () clause. It is conceptually similar to the ON clause, but requires that the connected column must have the same name. The following query statement can connect the mytbl1.b to the mytbl2.b
SELECT mytbl1.*,mytbl2.* FORM mytbl1 INNER JOIN mytbl2 USING (b);
2. Left outer and right outer connections
The left OUTER join uses the right join
The left JOIN works by specifying the columns used to match the rows in the two table, and then, when a row in the right table of the left table row matches, the contents of the two rows are selected as an output line, and when a row of left table does not match in the right side,
It will still be selected as an output line, except that it is connected to a dummy row of the right table, where each column contains null.
It is important to note that there is no problem with the row in the result set of the right table, which is defined as NOT NULL. For example, if the right table contains a column with a value of NULL, you cannot distinguish these null values from those that identify unmatched rows.
MySQL uses connections for multi-table retrieval