lSQL.append(" from acp1, acp2, acp4, acp3");
lSQL.append(" where acp1.pac101 = acp2.pac101(+)");
lSQL.append(" and acp1.aae100 = '1'");
lSQL.append(" and acp4.pac301(+) = acp3.pac301");
lSQL.append(" and acp3.pac101(+) = acp1.pac101");
今天看公司代码的过程中 突然冒了个(+)出来,这是啥?原来这是外连接的简写。。。
实习生读书少啊。。。原谅我没见过。
左外连接
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(+)
右外连接
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