join 分為 inner join left join right join假設表 a 有欄位 empid empname
1 jack
2 tom表b 有欄位 empid empaddr 1 bj
3 shinner join標準語法如下select a.empid,b.empaddr from a inner join b on a.id=b.id結果如下1 bjleft joinselect a.empid,b.empname from a left join b on a.id=b.id結果如下1 bj2 nullright joinselect a.empid,a.empaddr from a right join b on a.id=b.id結果如下1 jack3 null
join 分為 inner join left join right join假設表 a 有欄位 empid empname
1 jack
2 tom表b 有欄位 empid empaddr 1 bj
3 shinner join標準語法如下select a.empid,b.empaddr from a inner join b on a.id=b.id結果如下1 bjleft joinselect a.empid,b.empname from a left join b on a.id=b.id結果如下1 bj2 nullright joinselect a.empid,a.empaddr from a right join b on a.id=b.id結果如下1 jack3 null