chad_small
ADSM.ORG Moderator
- Joined
- Dec 17, 2002
- Messages
- 2,262
- Reaction score
- 52
- Points
- 0
- Location
- Gilbert, AZ
- Website
- www.tsmadmin.com
I am trying to calculate the difference in occupancy and num_files between two storage pools using the occupancy table. What I get when I run my command is an incorrect calculation because I cannot seem to separate the sum by pool correctly within the select. There has to be a way to do this, here is my select for just the LOGICAL_MB and I know what it's doing I just need a way to separate the sum. Once I figure out how to separate the sums I'll expand it to show the difference in NUM_FILES also.
select cast((sum(BIGINT(a.LOGICAL_MB/1024))) - sum(BIGINT(b.LOGICAL_MB/1024)) as decimal(8,2)) as GB_DIFF from occupancy a, occupancy b where a.stgpool_name='XY-STD-COPY' and b.stgpool_name='XY-STD-TAPE'
Obviously my select is not seperating a.stgpool_name data from b.stgpool_name data because the result is incorrect.
select cast((sum(BIGINT(a.LOGICAL_MB/1024))) - sum(BIGINT(b.LOGICAL_MB/1024)) as decimal(8,2)) as GB_DIFF from occupancy a, occupancy b where a.stgpool_name='XY-STD-COPY' and b.stgpool_name='XY-STD-TAPE'
Obviously my select is not seperating a.stgpool_name data from b.stgpool_name data because the result is incorrect.