One, key words:
1) Left (connection type) join on (condition)
two, common connections:
1) Join (acquisition of a Cartesian product),
SELECT * from T_table1 join T_table2;
2) Left connection (two table associations, after matching criteria, left table remains all, that is, contains no match to the field)
SELECT * from T_table1 LEFT join t_table2 on t_table1.id = t_table2. ID;
3) Right connection (two table associations, after matching criteria, the right table retains all, contains no match to the field)
SELECT * from T_table1 right join t_table2 on t_table1.id = t_table2. ID;
4) Inner connection (get intersection)
SELECT * FROM T_table1 inner join t_table2 on t_table1.id = t_table1. ID;
5) Check only the contents of the left table (two table associations, query the data unique to the left table)
SELECT * from T_table1 left joins t_table2 on t_table1.id = t_table2. ID where t_table2.id is null;
6) Only the right table content (two table association, query the right table unique data)
SELECT * from T_table1 left joins t_table2 on t_table1.id = t_table2. ID where t_table1.id is null;
7) Fully connected
SELECT * from T_table1 LEFT join T_table2 on t_table1. id = t_table2.id
Union
SELECT * from T_table1 right join T_table2 on t_table1. id = t_table2.id;
8) go to the intersection
SELECT * from T_table1 LEFT join t_table2 on t_table1.id = t_table2. ID where t_table2. ID is null
Union
SELECT * from T_table1 right join t_table2 on t_table1.id = t_table2. ID where t_table1. ID is null;
MySQL Database association query "Lert join" common use