oracle 导出多表数据合并,Oracle数据库,join多表关联方式、union结果集合并

join on :   多表关联

内连接 :与其他表连接

from 表1 t join 表2 s on t.字段1 =s.字段2 join 表3 n on n.字段3=t.字段1

from 表1 a ,表2 b,表3c where a.字段=b.字段

自连接: 与自身连接

from 表1 t join 表1 s on t.字段1 =s.字段1 s.字段1=t.字段1

外连接:左/右连接

left join on 左连接 保证左边表的数据全部显示

right join on 右连接 保证右边表的数据全部显示

全连接:保证两边的表的数据全部出现

full join on

union:结果集合并

要求:前后数据的列数和字段类型要一致

例:

select s.name,s.sex,t.cno from student s

union

select t.name,t.sex,t.cno from student t

去掉重复数据并合并

select s.name,s.sex,t.cno from student s

union all

select t.name,t.sex,t.cno from student t

不去掉重复数据并合并

原文:http://www.cnblogs.com/zhaotiancheng/p/6188855.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值