暫存的資料統計方法說明

gyang發表於2007-01-12
select nvl(dw,'全部單位')dw,nvl(sfxmmc,'收費合計')sfxmmc, je from
(
select getdwbyxh(zbid) dw,sfxmmc,sum(sfje) je from fs_czsfmxb where getdwbyxh(zbid) is not null group by rollup(getdwbyxh(zbid),sfxmmc)
)
select nvl(getdwbyxh(zbid),'全部單位') dw,nvl(sfxmmc,'收費合計') sfxmmc,sum(sfje) je from fs_czsfmxb where getdwbyxh(zbid) is not null group by rollup(getdwbyxh(zbid),sfxmmc)
select nvl(sfxmmc,'收費合計')sfxmmc,nvl(dw,'全部單位')dw, je from
(
select sfxmmc, getdwbyxh(zbid) dw,sum(sfje) je from fs_czsfmxb where getdwbyxh(zbid) is not null group by rollup(sfxmmc,getdwbyxh(zbid))
)
select nvl(sfxmmc,'收費合計') sfxmmc, nvl(getdwbyxh(zbid),'全部單位') dw,sum(sfje) je from fs_czsfmxb where getdwbyxh(zbid) is not null group by rollup(sfxmmc,getdwbyxh(zbid))[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15247/viewspace-890031/,如需轉載,請註明出處,否則將追究法律責任。

相關文章