数据库问题 求批量处理的方法

针对yddw表的每一个YDDWSYH索引号 需要在另外一个表插入5条数据 对应sql是
--地均税收
insert into GYYD_PGXJG t
select yddwsyh,00,00,
case when djss>32 then 40
when 20<djss and djss<=32 then 30
when 10<djss and djss<=20 then 24
when 5<djss and djss<=10 then 16
when 5>=djss then 8
else 999 end,sys_guid() from yddw where yddwsyh='321112000093';
--地均营业收入
insert into GYYD_PGXJG t
select yddwsyh,00,01,
case when djsr>100 then 20
when 75<djsr and djsr<=100 then 16
when 50<djsr and djsr<=75 then 12
when 25<djsr and djsr<=5 then 8
when 5>=djsr then 4
else 999 end,sys_guid() from yddw where yddwsyh='321112000093';
--地均从业人员
insert into GYYD_PGXJG t
select yddwsyh,00,02,
case when djcyry>800 then 20
when 350<djcyry and djcyry<=800 then 16
when 156<djcyry and djcyry<=350 then 12
when 128<djcyry and djcyry<=156 then 8
when 128>=djcyry then 4
else 999 end,sys_guid() from yddw where yddwsyh='321112000093';
--人均上交税金
insert into GYYD_PGXJG t
select yddwsyh,00,03,
case when (case when  CYRY=0 then 0 else nvl(ROUND(SJSJ/CYRY,2),0.0)  end )>200 then 10
when 100<(case when  CYRY=0 then 0 else nvl(ROUND(SJSJ/CYRY,2),0.0)  end ) and (case when  CYRY=0 then 0 else nvl(ROUND(SJSJ/CYRY,2),0.0)  end )<=200 then 8
when 50<(case when  CYRY=0 then 0 else nvl(ROUND(SJSJ/CYRY,2),0.0)  end ) and (case when  CYRY=0 then 0 else nvl(ROUND(SJSJ/CYRY,2),0.0)  end )<=100 then 6
when 10<(case when  CYRY=0 then 0 else nvl(ROUND(SJSJ/CYRY,2),0.0)  end ) and (case when  CYRY=0 then 0 else nvl(ROUND(SJSj/CYRY,2),0.0)  end )<=50 then 4
when 10>=(case when  CYRY=0 then 0 else nvl(ROUND(SJSJ/CYRY,2),0.0)  end ) then 2
else 999 end,sys_guid() from yddw where yddwsyh='321112000093';
--人均营业收入
insert into GYYD_PGXJG t
select yddwsyh,00,04,
case when (case when  CYRY=0 then 0 else nvl(ROUND(YYSR/CYRY,2),0.0)  end )>200 then 10
when 100<(case when  CYRY=0 then 0 else nvl(ROUND(YYSR/CYRY,2),0.0)  end ) and (case when  CYRY=0 then 0 else nvl(ROUND(YYSR/CYRY,2),0.0)  end )<=200 then 8
when 50<(case when  CYRY=0 then 0 else nvl(ROUND(YYSR/CYRY,2),0.0)  end ) and (case when  CYRY=0 then 0 else nvl(ROUND(YYSR/CYRY,2),0.0)  end )<=100 then 6
when 15<(case when  CYRY=0 then 0 else nvl(ROUND(YYSR/CYRY,2),0.0)  end ) and (case when  CYRY=0 then 0 else nvl(ROUND(YYSR/CYRY,2),0.0)  end )<=50 then 4
when 15>=(case when  CYRY=0 then 0 else nvl(ROUND(YYSR/CYRY,2),0.0)  end ) then 2
else 999 end,sys_guid() from yddw where yddwsyh='321112000093';

但是yddw表的yddwsyh 有30万条。怎么能快速插入啊
FineReport阳光走了猫不来 发布于 2017-5-10 09:36
悬赏:2 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共4回答
最佳回答
0
小龙发布于2017-5-10 09:36(编辑于 2023-9-6 09:34)
555
最佳回答
0
flyingsnake发布于2017-5-10 09:38(编辑于 2023-9-6 09:34)
555
最佳回答
0
阳光走了猫不来发布于2017-5-15 08:36(编辑于 2023-9-6 09:34)
555
最佳回答
0
danchengtao发布于2017-5-15 09:17(编辑于 2023-9-6 09:34)
555
  • 0关注人数
  • 505浏览人数
  • 最后回答于:2017-5-15 09:17
    活动推荐 更多
    热门课程 更多
    返回顶部