两个表有重复的字段名怎么把数据插入到另一张表里 table_a a b c 1 2 3 4 5 6table_b a b c d 7 8 9 0怎么把 table_a 里的数据插入到 table_b 里 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 insert into table_bselect a.a,a.b,a.c,0from table_a a SQL> with ta as( 2 select 1 a,2 b,3 c from dual union all 3 select 4,5,6 from dual) 4 select a,b,c,0 d 5 from ta 6 / A B C D---------- ---------- ---------- ---------- 1 2 3 0 4 5 6 0 什么叫没有足够的值,我都不知道你的数据是怎么来的:table_a a b c 1 2 3 4 5 6table_b a b c d 7 8 9 0能告诉大家,你的数据怎么来的吗?或者经过什么计算得到的...... SQL> create table table_a(a number primary key,b number,c number); Table created SQL> create table table_b(a number primary key,b number,c number,d number); Table created SQL> insert into table_a values(1,2,3); 1 row inserted SQL> insert into table_a values(4,5,6); 1 row inserted SQL> commit; Commit complete SQL> insert into table_b values(7,8,9,0); 1 row inserted SQL> commit; Commit complete SQL> select * from table_a; A B C---------- ---------- ---------- 1 2 3 4 5 6 SQL> select * from table_b; A B C D---------- ---------- ---------- ---------- 7 8 9 0 SQL> insert into table_b(a,b,c) select * from table_a; 2 rows inserted SQL> commit; Commit complete SQL> select * from table_b; A B C D---------- ---------- ---------- ---------- 7 8 9 0 1 2 3 4 5 6 insert into a (a,b,c) select a,b,c from b ; 求一删除SQL语句 求一条简单的去重语句 触发问题 ORA-06508: PL/SQL: 无法找到正在调用 的程序单元 关联查询优化 sql语句:如何查找一个表中部分相同的记录? oracle装在d盘,C盘格式化后,数据还能恢复吗 请教AIX上Oracle9i内存泄漏问题,急! 一个float类型的查询 请问从Oracle网站(www.oracle.com)上下载的oracle9i是不是试用版? oraclehome92TNSlistener服务的解读 要进入SQLPLUS之前必须启动哪些服务啊??请指点
insert into table_b
select a.a,a.b,a.c,0
from table_a a
SQL> with ta as(
2 select 1 a,2 b,3 c from dual union all
3 select 4,5,6 from dual)
4 select a,b,c,0 d
5 from ta
6 /
A B C D
---------- ---------- ---------- ----------
1 2 3 0
4 5 6 0
table_a
a b c
1 2 3
4 5 6table_b
a b c d
7 8 9 0
能告诉大家,你的数据怎么来的吗?
或者经过什么计算得到的......
SQL> create table table_a(a number primary key,b number,c number);
Table created
SQL> create table table_b(a number primary key,b number,c number,d number);
Table created
SQL> insert into table_a values(1,2,3);
1 row inserted
SQL> insert into table_a values(4,5,6);
1 row inserted
SQL> commit;
Commit complete
SQL> insert into table_b values(7,8,9,0);
1 row inserted
SQL> commit;
Commit complete
SQL> select * from table_a;
A B C
---------- ---------- ----------
1 2 3
4 5 6
SQL> select * from table_b;
A B C D
---------- ---------- ---------- ----------
7 8 9 0
SQL> insert into table_b(a,b,c) select * from table_a;
2 rows inserted
SQL> commit;
Commit complete
SQL> select * from table_b;
A B C D
---------- ---------- ---------- ----------
7 8 9 0
1 2 3
4 5 6