(1)左连接 left join 在查询结果中包含join左侧表中的所有记录,以及join右侧表中匹配的纪录
(2)右连接 right join 在查询结果中包含join右侧表中的所有记录,以及join左侧表中匹配的纪录
(3)全连接 full join 在结果中包含join.
例子如下:
select
nvl(left_.dummy,'这是要右边的全部') left_dummy,
nvl(right_.dummy,'这是要左边的全部') right_dummy
from dual left_ left JOIN dual right_
on left_.dummy||'d' = right_.dummy
select
nvl(left_.dummy,'这是要右边的全部') left_dummy,
nvl(right_.dummy,'这是要左边的全部') right_dummy
from dual left_ RIGHT JOIN dual right_
on left_.dummy||'d' = right_.dummy
select
nvl(left_.dummy,'这是要右边的全部') left_dummy,
nvl(right_.dummy,'这是要左边的全部') right_dummy
from dual left_, dual right_
WHERE left_.dummy||'d' = right_.dummy(+)
[此贴子已经被admin于2010-12-13 20:15:34编辑过]