内连接inner join
(第1种写法)select a.Name,b.Name from t_Table1 a join t_Table2 b on a.ID=b.ID
(第2种写法)select a.Name b.Name from t_Table1 a inner join t_Table2 b on a.ID=b.ID
两表之间的左连接(右连接完全是简单的举一反三,所以就不写了)
select a.Name,b.Name from t_table1 a left join t_table b on a.ID=b.ID
4表之间的左连接(t_Table1 既需要左关联t_Table2,又同时需要左关联t_Table3,t_Table4无用)
select a.Name,b.Name,c.Name
from t_Table1 a left join t_Table2 b on a.ID=b.ID left join t_Table3 c on a.ID=c.ID,
t_table4 d
where a.ID=d.ID
等连接
select a.Name,b.Name from t_Table1 a,t_Table b
where a.ID=b.ID
全连接(Full join)
select a.Name,b.Name from t_table1 a full join t_Table2 b on a.ID=b.ID