can someone explain why D, is returning 0??? and what a proper solution would be?
ultimately i'm just trying to calculate the percent of increase between A and B
SELECT distinct a.diobli as library
,sum(a.diobsz) as a
,(select sum(diobsz) from dskspace.QAEZ170714
where diobli = a.diobli) as b
,sum(a.diobsz) -
(select sum(diobsz) from dskspace.QAEZ170714
where diobli = a.diobli) as c
,(sum(a.diobsz) -
(select sum(diobsz) from dskspace.QAEZ170714
where diobli = a.diobli)) / sum(a.diobsz) as d
from qusrsys.qaezdisk a
where a.diobli = 'LDATAT3X'
group by a.diobli
ultimately i'm just trying to calculate the percent of increase between A and B
SELECT distinct a.diobli as library
,sum(a.diobsz) as a
,(select sum(diobsz) from dskspace.QAEZ170714
where diobli = a.diobli) as b
,sum(a.diobsz) -
(select sum(diobsz) from dskspace.QAEZ170714
where diobli = a.diobli) as c
,(sum(a.diobsz) -
(select sum(diobsz) from dskspace.QAEZ170714
where diobli = a.diobli)) / sum(a.diobsz) as d
from qusrsys.qaezdisk a
where a.diobli = 'LDATAT3X'
group by a.diobli
LDATAT3X | 31210811392 | 30677762048 | 533049344 | 0 |
Comment