上次贴出的日志,我没整明白,就知道结果,真的不用不知道,用了才知道
理论指导实践,同时,没有实践,一切理论都是白搭。工作中再一次犯到了
类似的错误,希望这次能进一步加强这块方面的知识,防止下次重复犯错!
[img]http://dl.iteye.com/upload/attachment/364111/8328c882-029f-309c-8cd6-1a46f97adcc0.jpg[/img]
结果是一样的,这样起不到左连接的作用
[img]http://dl.iteye.com/upload/attachment/364118/662d6778-a05d-32c3-9cc2-a45f53a74136.jpg[/img]
左连接的效果做到了!
[img]http://dl.iteye.com/upload/attachment/364128/d4394311-80f8-3bbd-b51a-9aaa545b1600.jpg[/img]
用left JOin也可以这样实现左连接并且
[img]http://dl.iteye.com/upload/attachment/364136/e8d19473-483a-3483-9bb8-30f6ff5b425d.jpg[/img]
理论指导实践,同时,没有实践,一切理论都是白搭。工作中再一次犯到了
类似的错误,希望这次能进一步加强这块方面的知识,防止下次重复犯错!
create table t AS
(SELECT 1 id, 'y' n
FROM dual
UNION ALL
SELECT 2 id, 'n' n
FROM dual
UNION ALL
SELECT 3 id, 'n' n
FROM dual
UNION ALL
SELECT 4 id, 'y' n FROM dual);
create table b AS
(SELECT 1 id, 'f' n
FROM dual
UNION ALL
SELECT 2 id, 'y' n
FROM dual
UNION ALL
SELECT 3 id, 'n' n FROM dual);
[img]http://dl.iteye.com/upload/attachment/364111/8328c882-029f-309c-8cd6-1a46f97adcc0.jpg[/img]
结果是一样的,这样起不到左连接的作用
[img]http://dl.iteye.com/upload/attachment/364118/662d6778-a05d-32c3-9cc2-a45f53a74136.jpg[/img]
左连接的效果做到了!
[img]http://dl.iteye.com/upload/attachment/364128/d4394311-80f8-3bbd-b51a-9aaa545b1600.jpg[/img]
用left JOin也可以这样实现左连接并且
[img]http://dl.iteye.com/upload/attachment/364136/e8d19473-483a-3483-9bb8-30f6ff5b425d.jpg[/img]