假设原始有一张表a 字段为 a1,a2,a3,a4
新建一张表B 字段为B1,B2,B3 B1,B2,B3的字段属性与A1,A2,A3相同
如果想把A表中A1,A2,A3的记录插入到B表的B1,B2,B3中 应该怎么来做呢?
insert into b(b1,b2,b3) as select a1,a2,a3 from A?这样好像不可以
新建一张表B 字段为B1,B2,B3 B1,B2,B3的字段属性与A1,A2,A3相同
如果想把A表中A1,A2,A3的记录插入到B表的B1,B2,B3中 应该怎么来做呢?
insert into b(b1,b2,b3) as select a1,a2,a3 from A?这样好像不可以
select a1,a2,a3 from A
已连接。
SQL> select * from ttt; ID NAME ROLE
---------- ---------- ----------
1 aa 1
1 aa 2
2 bb 3
3 cc 4SQL> create table ttt1 as select * from ttt;表已创建。SQL> truncate table ttt1;表被截断。SQL> insert into ttt1 select * from ttt;已创建4行。SQL> commit;提交完成。
insert into b(b1,b2,b3) select a1,a2,a3 from A?