日期:2014-05-20  浏览次数:20735 次

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(+)
....
......
.....
------解决方案--------------------
看看可行,不过这样适合已第一张表为主,其余与此表进行左连接的。