SQL 3种联合查询

来源:互联网 发布:酷我音乐网络代理设置 编辑:程序博客网 时间:2024/06/06 07:46

[First]表                                                            [Second]表

       

 

-- 交叉连接,输出4*5条记录select * from [First],[Second]select * from [First] cross join [Second]

 

-- 内连接select * from [First] F,[Second] S where F.B = S.Bselect * from [First] F inner join [Second] Son F.B = S.B

 

-- 左外连接select * from [First] F left outer join [Second] Son F.B = S.B

 

-- 右外连接select * from [First] F right outer join [Second] Son F.B = S.B

 

-- 左右外连接 --!select * from [First] F full outer join [Second] Son F.B = S.B