create table charge_dtl_tmp as select * from charge_dtl where activity='DG';
update charge_dtl_tmp set activity='DC' where activity='DG';
insert into charge_dtl(select * from charge_dtl_tmp where activity='DC');
drop table charge_dtl_tmp;
create table charge_instr_tmp as select * from charge_instr where activity='DG';
update charge_instr_tmp set activity='DC' where activity='DG';
insert into charge_instr(select * from charge_instr_tmp where activity='DC');
drop table charge_instr_tmp;
commit;
本文介绍了一种通过创建临时表的方式进行数据批量更新与迁移的方法。具体步骤包括:创建临时表并复制源表中特定条件的数据,修改临时表中的数据,将修改后的数据插入到目标表中,并删除临时表。
1万+

被折叠的 条评论
为什么被折叠?



