Oracle复制某一个字段 批量修改(我们可以在插入的时候修改)

--删除 aa_client_id<>660
delete from b_business_type a1 where a1.aa_client_id <> 660;


 

--复制 aa_client_id=660的,并且把复制后的 aa_client_iD修改成360
insert into b_business_type
  (id,
   aa_client_id,
   aa_org_id,
   create_by,
   create_date,
   update_by,
   update_date,
   isactive,
   entitytype,
   status,
   code,
   name,
   shortname,
   eng_name,
   b_business_type_id,
   b_business_type_id_top,
   up_rate,
   member_rate,
   aa_headquarter_id,
   formkey,
   formview,
   b_business_id)
  select b_business_type_seq.nextval,
         360 aa_client_id, --360
         1440 aa_org_id, --1440
         1461 create_by,
         a1.create_date,
         1461 update_by,
         a1.update_date,
         a1.isactive,
         a1.entitytype,
         a1.status,
         a1.code,
         a1.name,
         a1.shortname,
         a1.eng_name,
         a1.b_business_type_id,
         a1.b_business_type_id_top,
         a1.up_rate,
         a1.member_rate,
         a1.aa_headquarter_id,
         a1.formkey,
         a1.formview,
         b_business_id
    from b_business_type a1
   where a1.aa_client_id = 660

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页