oracle有多个表怎么连接呢?/

cargogood 2007-05-01 08:19:00
本人有如下表

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

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

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


...全文
183 2 打赏 收藏 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
哈哈007哈 2007-05-01
  • 打赏
  • 举报
回复
看看可行,不过这样适合已第一张表为主,其余与此表进行左连接的。
哈哈007哈 2007-05-01
  • 打赏
  • 举报
回复
可以这样

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(+)
....
......
.....

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧