sql 一个表中的数据怎么导入到另一个表里
1、创建两张测试表,
create table test_imp1(id number, value varchar2(20));
create table test_imp2(id number, value varchar2(20));
2、表1插入7条测试数据,表2不做任务处理,
insert into test_imp1 values(1,'001');
insert into test_imp1 values(2,'001');
insert into test_imp1 values(2,'002');
insert into test_imp1 values(2,'002');
insert into test_imp1 values(2,'002');
insert into test_imp1 values(3,'003');
insert into test_imp1 values(3,'003');
3、将test_imp1表的记录插入test_imp2表,insert into test_imp2 select * from test_imp1, 有7条记录插入,
4、查询表test_imp2中记录,select t.*, rowid from test_imp2 t;与test_imp1的记录一致;