http://www.cnblogs.com/pcsky/archive/2004/10/27/57449.html
多表连接的SQL写法(SqlServer、Oracle)
Oracle8
select a.*,b.* from a,b where a.id(+)=b.id --相当于左联接
select a.*,b.* from a,b where a.id=b.id(+) --相当于右联接
Oracle9
支持以上的写法,还增加了LeftJoin、Right Join等
select a.*,b.* from a left join b on a.id=b.id
select a.*,b.* from a right join b on a.id=b.id
Sqlserver
select a.*,b.* from a,b where a.id *= b.id --相当于左联接
select a.*,b.* from a,b where a.id =* b.id --相当于右联接
select a.*,b.* from a left join b on a.id=b.id
select a.*,b.* from a right join b on a.id=b.id
select a.*,b.* from a,b where a.id(+)=b.id --相当于左联接
select a.*,b.* from a,b where a.id=b.id(+) --相当于右联接
Oracle9
支持以上的写法,还增加了LeftJoin、Right Join等
select a.*,b.* from a left join b on a.id=b.id
select a.*,b.* from a right join b on a.id=b.id
Sqlserver
select a.*,b.* from a,b where a.id *= b.id --相当于左联接
select a.*,b.* from a,b where a.id =* b.id --相当于右联接
select a.*,b.* from a left join b on a.id=b.id
select a.*,b.* from a right join b on a.id=b.id
博客主要介绍了SqlServer和Oracle数据库中多表连接的SQL写法,为数据库操作提供了相关技术参考,有助于提升在这两种数据库中进行多表数据处理的能力。
1015





