日期:2014-05-18  浏览次数:20773 次

十万火急,请兄弟们多帮忙!
像下面这样的oracle统计汇总语句改造成informix语句怎么写?

select   (case   when   jgbh   is   null   and   gsmc   is   null   then   '总计 '   when   jgbh   is   not   null   and   gsmc   is   null   then   '小计 '   else   jgbh   end)   as   jgbh,gsmc,cplx,cpmc,count(*)   as   bds,sum(tbfs)   as   tbfs,sum(bxfy)   as   bxfy,sum(bxje)   as   bxje,   sum(f.sxf)   as   sxf
from(   select   a.jgbh   as   jgbh,   c.gsmc   as   gsmc,d.prompt   as   cplx,b.cpmc   as   cpmc,a.tbfs   as   tbfs,   a.bxfy   as   bxfy,   a.bxje   as   bxje,f.sxf   as   sxf   from   gapsdb30:yw_ybt_bdxxb   a,gapsdb30:yw_ybt_cpxxb   b,gapsdb30:yw_ybt_gsxxb   c,gapsdb30:yw_ybt_dict   d,gapsdb30:yw_ybt_ywls   f
where   a.gsdm=c.gsdm   and   a.cpdm=b.cpdm   and   d.HS_KEY= 'D_CPLX '   and   b.cplx=d.val   and   a.bdzt= '0 '   and   a.tbrq> = '20070801 '   and   a.tbrq <= '20070820 '   and   a.SLLSH=f.ZHQZLSH   )aa   group   by   rollup(aa.jgbh,gsmc,cplx,cpmc)

------解决方案--------------------
帮顶,不会~~
------解决方案--------------------
兄弟,发错地方了吧,移到数据库版本去吧~~
------解决方案--------------------
帮顶,不会~~