现有张表,字段A,B,C,表中A,B字段已有数据
A,B
1 1
2 2
3 3
4 4
现有一个文档提供了A和C字段,数据格式如下
A,C
1 'A'
2 'B'
3 'C'
导入后表的数据应该是
A,B,C
1 1 'A'
2 2 'B'
3 3 'C'
4 4
怎么才能把C字段数据导入到表中
A,B
1 1
2 2
3 3
4 4
现有一个文档提供了A和C字段,数据格式如下
A,C
1 'A'
2 'B'
3 'C'
导入后表的数据应该是
A,B,C
1 1 'A'
2 2 'B'
3 3 'C'
4 4
怎么才能把C字段数据导入到表中
update table
set c=(select c from temp where table.a=a)
==========================
用 sql loader
sql loader要怎么用?
能详细说说吗,谢谢
把文档用SQL*Loader导入tab2;
create table tab1 as select a,b from target_table;
在tab1和tab2上create index;
truncate table target_table;
insert into target_table (a,b,c)
select ... from tab1,tab2 where tab1.a=tab2.a;
commit;
这种操作一定要保证target_table被你独占,其他人不能使用,否则会出现数据不一致。