本文整理自网络,侵删。
本文目的:
通过分析左连接(+)加号的写法和一些常用语法之间的联系,了解到Oracle 加号(+)的用法
分析步骤:
1.首先创建测试表的结构:
create table test_left_a ( a varchar2(50), b varchar2(50) ) create table test_left_b ( a varchar2(50), b varchar2(50) )
2.插入相应的测试数据:
insert into test_left_a select 'a','21' from dual; commit; insert into test_left_a select 'c','2111' from dual; commit; insert into test_left_b select 'a','12' from dual; commit; insert into test_left_b select 'b','13' from dual; commit;
3.列举出实现左连接查询的几种常用的语法,以便对比分析
实现左连接查询(不加where)的几种语法:
A:
select * from test_left_a a left join test_left_b b on a.a = b.a;
B:
select * from test_left_a a, test_left_b b where a.a = b.a(+);
C:
select * from test_left_a a inner join test_left_b b on a.a = b.a(+);
实现左连接查询(加where)的几种语法:
相关阅读 >>
oracle ora-01114、ora-27067错误解决方法
更多相关阅读请进入《oracle》频道 >>
数据库系统概念 第6版
本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。