1. Internal connection
Connect the same meaning field in two tables and return the information that is present in the two tables:
SELECT * from Tablea,tableb where TableA. field c=tableb. field C;
SELECT * FROM TableA inner join TableB on TableA. field c=tableb. field C;
TableA. field C=tableb. field C is a filter condition.
2. Left Outer connection
Use each record in the first table to match the record for the second table, regardless of whether it matches the record, the query results show all the contents of the first table
SELECT * from TableA left outer joins TableB on TableA. field c=tableb. field C;
3. Right outer connection
Use each record in the second table to match the record for the first table, regardless of whether it matches the record, the query results show all the contents of the second table
SELECT * FROM TableA right outer join TableB on TableA. field c=tableb. field C;
4. Full connection
Left OUTER join and right outer JOIN and set
SELECT * from TableA left outer joins TableB on TableA. field C=tableb. field C Union select * FROM TableA right outer join TableB on TableA. field C=tableb. field C
5. Correlated sub-query
The result of the first query is used as a condition for the second query.
MYSQL Correlation Query