For MySQL internal connections, outer connections, cross connections
1. Internal connection : Combine the rows in two tables that meet the join criteria as a result set------inner
Syntax: Select column 1, column 2, column n from table one inner join table two on table one column = Table two column []where conditional statement]
eg
Table I (Qiche)
Table II (QICHE1)
SELECT * FROM Qiche inner join qiche1 on qiche.id=qiche1.id results are as follows:
2. External connection
A. Left connection (On the basis of the join, it also contains all the non-qualifying rows of data in the left table, and fills in the right table column with null)-----------
Syntax: Select column 1, column 2, column n from table one left join table two on table one column = table two columns
Eg:select * from Qiche left joins Qiche1 on Qiche. Brand =qiche1. Brand results are as follows:
B. Right connection (On the basis of the join, it also contains all the non-qualifying rows of data in the right table, and the left table column is filled with null)------------
Syntax: Select column 1, column 2, column n from table one right join table two on table one column = table two columns
C. Full outer join (on the basis of the inner joins, also contains all the non-qualifying data rows in the two tables, and the left table, and the right table column in which null is filled)-------full
But in fact MySQL does not support full-outer connections
3. Cross-connect (The thing to do is to regroup each row of data in one table and all the rows in another table to form a new data table, the number of data bars for the result: Left table row X right table row number
There is a concept called Cartesian product)-----------Cross Join
Syntax: SELECT * FROM Table a cross join Table II
Eg:select * The results from the Qiche cross join Qiche1 are as follows:
MySQL Learning (vi) MySQL connection