简单统计报表例子(存储过程)

前端之家收集整理的这篇文章主要介绍了简单统计报表例子(存储过程)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. 1 create or replace procedure bb_quxzbmjdqzxfqk_ces(kssj in date, 2 jssj 3 wtsd2 varchar2,128);"> 4 tjjg out sys_refcursor) as
  2. 5
  3. 6 begin
  4. 7 delete from A_TJBB_quxzbmjdqzxfqk;
  5. 8 commit;
  6. 9 insert into A_TJBB_quxzbmjdqzxfqk
  7. 10 select jj.iidd,jj.isedit,jj.djjgbh,jj.cfxfjbz,jj.lmbz,jj.xfrs,jj.xfxs from visit_xfj jj,128);">11 hr_organization n where n.jglb='1200' and n.region_dm=wtsd2 and n.bh=jj.djjgbh and jj.djsj between kssj and jssj;
  8. 12 13 open tjjg for
  9. 14
  10. 15
  11. 16 select l.mc as mc,128);">17 count(1) as jianci,128);">18 sum(case when xf.xfxs100' then 1 else
  12. 19 200then xf.xfrs 20 when xf.xfxs in (300',303') 1
  13. 21 else 0 end end) as rci,128);">22 and xf.lmbz0'and xf.cfxfjbzend)as grlx,128);">23 1as lmx,128);">24 as cfgrlx,128);">25 as cflmx,128);">26 as xiaojie,128);">27 and xf.xfrs<=4 as c1lfcjjc,128);">28 as c1lfcjrc,128);">29 and( xf.xfrs>=5 49) as c5lfcjjc,128);">30 as c5lfcjrc,128);">31 50 499) as c50lfcjjc,128);">32 then xf.xfrs as c50lfcjrc,128);">33 500 as c500lfcjjc,128);">34 as c500lfcjrc,128);">35 as cf1lfcjjc,128);">36 as cf1lfcjrc,128);">37 as cf5lfcjjc,128);">38 as cf5lfcjrc,128);">39 as cf50lfcjjc,128);">40 as cf50lfcjrc,128);">41 as cf500lfcjjc,128);">42 as cf500lfcjrc,128);">43 as lxxiaojjc,128);">44 as lxxiaojrc,128);">45 in(') as grts,128);">46 as lmts,128);">47
  14. 48 as cfgrts,128);">49
  15. 50 as cflmts,128);">51 as xiaoji
  16. 52
  17. 53 from hr_organization l,A_TJBB_quxzbmjdqzxfqk xf where l.jglband l.region_dm500101and l.bh=xf.djjgbh group by l.mc;
  18. 54
  19. 55 end bb_quxzbmjdqzxfqk_ces;

————————————————————————————————————————————————————————————————————

  1. 4 isquxian 5 tjjg out GLOBALPKG.RCT1) 6
  2. 7 8 v_kssj1 :=kssj;
  3. 9 v_jssj1 :=jssj;
  4. 10 11
  5. 12
  6. 13 14 15 16 18 19 20 21 44
  7. 46
  8. 47 50 where l.region_dmand ((v_kssj1 is not null and j.adddatetime between v_kssj1 and v_jssj1)
  9. 51 or (v_kssj1 not nulll and 1=1)) and((isquxian and ion.dm = isquxian ) or (isquxian is 1 = 1)) and l.jglband
  10. 53 l.bhend bb_quxzbmjdqzxfqk_ces;

猜你在找的Oracle相关文章