我说的不准确
一个例子:
select a.xm,a.xb,a.csrq,b.xm,b.xb,b.csrq
from t_ygjbxx a,t_ygqs b
where a.ygid=b.ygid(+)
t_ygjbxx 员工信息 xm 姓名 xb 性别 csrq 出生日期
t_ygqs 员工亲属
每个员工不是都有亲属的,但仍然返回所有员工的信息。
一个例子:
select a.xm,a.xb,a.csrq,b.xm,b.xb,b.csrq
from t_ygjbxx a,t_ygqs b
where a.ygid=b.ygid(+)
t_ygjbxx 员工信息 xm 姓名 xb 性别 csrq 出生日期
t_ygqs 员工亲属
每个员工不是都有亲属的,但仍然返回所有员工的信息。
显示a表和b表所有的列值
select a.col,b.col from a,b where a.col=b.col(+);显示a表和b表共同的列值
select a.col,b.col from a,b where a.col=b.col;显示出a表有而b表没有的列值
select a.col,b.col from a,b where a.col=b.col(+) and b.col is null;
怎么是union呢?
where a.deptno=b.deptno(+);看看结果和我的解释就明白了。
不僅把公共屬性相等的對應紀錄顯示出來
還把a表中剩余的那些記錄顯示出來﹐對應的b表字段補成null值a.col1(+)=b.col 同理
In the syntax:
table1.column = is the condition that joins (or relates) the tables together.
table2.column (+) is the outer join symbol, which can be placed on either side of the WHERE clause condition, but not on both sides (Place the outer join symbol following the name of the column in the table without the matching rows.)