oracle 新的数据库新的change

前端之家收集整理的这篇文章主要介绍了oracle 新的数据库新的change前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
--本游标是处理 declare cursor c is select JIOYRQ,tjjgh,TJGY,bxgs,sum(jioyje) jioyjesum,count(tbdh) tbdhsum from bx_mir_dsmx WHERE jioyrq = V_SYSDAT group by JIOYRQ,bxgs; v_jioyrq t_ls2_tj020_01.jioyrq%type; v_tjjgh t_ls2_tj020_01.tjjgh%type; v_TJGY T_LS2_TJ020_01.TJGY%type; v_bxgs t_ls2_tj020_01.bxgs%type; V_JIOYJESUM T_LS2_tj020_01.JIOYJESUM%TYPE; V_TBDHSUM T_LS2_tj020_01.TBDHSUM%TYPE; /*cursor p is select count(*) khsum from (select distinct tbr,lxdh from bx_mir_dsmx where jioyrq=v_jioyrq and TJGY=v_TJGY and bxgs=v_bxgs);*/ v_khsum t_ls2_tj020_01.khsum%type; begin open c; loop fetch c into v_jioyrq,v_tjjgh,v_TJGY,v_bxgs,V_JIOYJESUM,V_TBDHSUM; exit when c%notfound; --open p; --fetch p into v_khsum; --exit when p%notfound; select count(*) into v_khsum from (select distinct tbr,lxdh from bx_mir_dsmx where jioyrq = v_jioyrq and TJGY = v_TJGY and bxgs = v_bxgs); insert into t_ls2_tj020_01 (jioyrq,TJJGH,BXGS,JIOYJESUM,TBDHSUM,khsum) values (v_jioyrq,V_TBDHSUM,v_khsum); commit; --close p; end loop; close c; end; 原文链接:https://www.f2er.com/oracle/207909.html

猜你在找的Oracle相关文章