怎么在Oracle9中合并多列

Soking 2004-11-01 04:14:21

select a,b,c from table1
union
select d,e,from table2

我想要得到结果有5个列,但上面的语句只能获得3个列,帮忙啊
a,b,c,d,e
-----------
...全文
176 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
sz_news 2004-11-04
  • 打赏
  • 举报
回复
select a||b||c||d||e from tablename
hutulaodao 2004-11-04
  • 打赏
  • 举报
回复
不明白搂住的意思
lzj033 2004-11-04
  • 打赏
  • 举报
回复
select a.a,a.b,a.c,b.d,b.e from table1 a,table2 b where 条件
zonelive 2004-11-04
  • 打赏
  • 举报
回复
select * from tb1,tb2
biliky 2004-11-04
  • 打赏
  • 举报
回复
楼上的搞错楼主的意思了,楼主是想将两个表里的多个字段合成一个表里,不是将一个表的多个列合成一个列。
luxuezhu 2004-11-02
  • 打赏
  • 举报
回复
select a.a||a.b||a.c||b.d||b.e from table1 a,table2 b where a.id=b.id
zhaokeke2004 2004-11-02
  • 打赏
  • 举报
回复
select a.a,a.b,a.c,b.d,b.e from table1 a,table2 b where a.id=b.id
ks9960 2004-11-02
  • 打赏
  • 举报
回复

楼主如果是要把毫无关系的2个表数据放到一起,这样的话 liangwqtps(几百K) 的方法是可以的,
如果是通过映射关系对应,那么就应该使用全外连接。
David1289 2004-11-01
  • 打赏
  • 举报
回复
select * from

(select a,b,c from table1
full outer join
select d,e,from table2
) t

要用到全外链接
liangwqtps 2004-11-01
  • 打赏
  • 举报
回复
bzszp(SongZip) ( ) 说的对

select a,b,c,null d,null e from table1
union
select null a,null b,null c, d,e from table2
这个?
zwj0712 2004-11-01
  • 打赏
  • 举报
回复
select a.a,a.b,a.c,b.d,b.e from table1 a left join table2 b on 条件
zwj0712 2004-11-01
  • 打赏
  • 举报
回复
select a.a,a.b,a.c,b.d,b.e from table1 a,table2 b where 条件
bzszp 2004-11-01
  • 打赏
  • 举报
回复
一楼的肯定不行!
bzszp 2004-11-01
  • 打赏
  • 举报
回复
9i?

select a,b,c,d,e from
(select rownum id,a,b,c from table1) t1
full outer join
(select rownum id,d,e from table2) t2 on t1.id=t2.id;
liangwqtps 2004-11-01
  • 打赏
  • 举报
回复
select a,b,c,null,null from table1
union
select null,null,null d,e,from table2

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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