首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

oracle有多个表如何连接呢?/

2012-02-20 
oracle有多个表怎么连接呢?/本人有如下表table1(customer_idvarchar(20),f1..f2....)table2(customer_idva

oracle有多个表怎么连接呢?/
本人有如下表

table1
(
customer_id   varchar(20),
f1..
f2..
.
.
)

table2
(
customer_id   varchar(20),
f3.
f4.
.
)
...................一共有18张表

结构类似,但我需要从每张表中查询一个字段拼成一张表,而我想用join  
但语句必须一层层的套上去,非常长
请问有什么好方法,一条语句出来




[解决办法]
可以这样

select table1.f1,table2.f2,table3.f3,
...........
from table1,table2,table3,............

where table1.customer_id = table2.customer_id(+)
and table1.customer_id = table3.customer_id(+)
....
......
.....
[解决办法]
看看可行,不过这样适合已第一张表为主,其余与此表进行左连接的。

热点排行