看代码的过程中 突然冒了个(+)出来,原来这是外连接的简写
select a.*,b.* from tableA a left join tableB b on a.id=b.id
等价于
select a.*,b.* from tableA a,tableB b where a.id=b.id(+)
这个表示选择所有tableA的记录,如果不满足a.id=b.id的tableB的相关值全部为null
如
a.id a.name b.id b.school
1 abc 1 whut
2 cde null null
右外连接
select a.*,b.* from tableA a right join tableB b on a.id=b.id
等价于
select a.*,b.* from tableA a,tableB b where a.id(+)=b.id
select a.*,b.* from tableA a left join tableB b on a.id=b.id
等价于
select a.*,b.* from tableA a,tableB b where a.id=b.id(+)
这个表示选择所有tableA的记录,如果不满足a.id=b.id的tableB的相关值全部为null
如
a.id a.name b.id b.school
1 abc 1 whut
2 cde null null
右外连接
select a.*,b.* from tableA a right join tableB b on a.id=b.id
等价于
select a.*,b.* from tableA a,tableB b where a.id(+)=b.id