Http://www.cnblogs.com/zzwlovegfj/archive/2012/06/23/2559593.html
******************************************************************
Left JOIN connection:
Select column 1, column 2, column n from
TableA left join TableB
On tableA. Column = TableB. Column (Normal is a foreign key column) [Here the table is connected to a large table, completely as a plain watch]
Where,having,group by ... Write as usual.
Right connection:
Select column 1, column 2, column n from
TableA right join TableB
On tableA. Column = TableB. Column (Normal is a foreign key column) [Here the table is connected to a large table, completely as a plain watch]
Where,having,group by ... Write as usual.
Internal connection:
Select column 1, column 2, column n from
TableA INNER JOIN TableB
On tableA. Column = TableB. Column (Normal is a foreign key column) [Here the table is connected to a large table, completely as a plain watch]
Where,having,group by ... Write as usual.
Left join: That is, the left table as the benchmark, to the right table to find matching data, can not find a match with null.
How to Remember:
1. The left and right connections can be converted to each other
2. You can convert the right connection to left join (and recommend the left join to replace the right connection, the compatibility will be better)
A stand on the left side of B---b stands on the right of a
A LEFT JOIN B---> B Right Join a is the same.
Internal connection: Query the left/right side of the data, do not leave the part of the null
The inner join is the intersection of the left and right connections.
Can you find the same set of left and right connections?
Currently MySQL is not available, it does not support external connections, outer joins, can be used to achieve the purpose of union.
MySQL left and right connections