SQL表间连接

select * from xxaa a,xxbb b where a.id(+)=b.idd;--右连接,以B表为基表,匹配B表中的都输出
select * from xxaa a,xxbb b where a.id=b.idd(+); --左连接,以A表为基表,匹配A表的都输出 相当于left join 和left outer Join
select * from xxaa a,xxbb b where a.id=b.idd;  -- =连接 A,B表都匹配才输出
select * from xxaa a left join xxbb b on (a.id=b.idd); --左内连
select * from xxaa a right join xxbb b on (a.id=b.idd); --右内连
select * from xxaa a full join xxbb b on (a.id=b.idd);   --完全连接 --A表和B表的 并集
select * from xxaa a inner join xxbb b on (a.id=b.idd);  --内连接 --A表和B表的 交集
select * from xxaa a left outer join xxbb b on (a.id=b.idd);--左外连
select * from xxaa a right outer join xxbb b on (a.id=b.idd); --右外连
select * from xxaa a full outer join xxbb b on (a.id=b.idd);  --完全外联
select * from xxaa a  join xxbb b on (a.id=b.idd);  --相当于= 连接

posted @ 2009-06-11 17:16  tiasys  阅读(282)  评论(0编辑  收藏  举报