select cast(SUM(A2.total_mb)/1024 as decimal(7,2)) as "GB_Backup_WinNT" from
nodes A1, auditocc A2 where A1.node_name=A2.node_name AND
A1.platform_name='WinNT'

This is another interesting one.
select stgpool_name as "Storage Pool Name         ", -
   cast(sum(est_capacity_MB*pct_utilized/100/1024) as decimal(7,3)) as
"Total GB in Pool", -
   cast(count(volume_name) as decimal(4,0)) as "Tapes " -
   from volumes -
   where stgpool_name like 'CPY%' -
      or stgpool_name like 'TAPE%' -
   group by stgpool_name

Storage Pool Name              Total GB in Pool     Tapes
--------------------------     ----------------     ------
CPY_DAY_NAPWIN                          391.495          7
CPY_DAY_NNSAIX                          274.055          6
CPY_DAY_NNSEXCH                         950.556         15
CPY_DAY_NNSLINUX_S390                     5.632          1


-----Original Message-----
From: brian welsh [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 2:00 PM
To: [EMAIL PROTECTED]
Subject: select statement in GB's


Hello,

I'm not a SQL-guru, and that's why I like some help with the following
statement.

I made the following statement:
select SUM(A2.total_mb) as "MB_Backup_WinNT" from nodes A1, auditocc A2
where A1.node_name=A2.node_name AND A1.platform_name='WinNT'

The output of the query is:
MB_Backup_WinNT
---------------
          86653

I will do this for every platform. Now I like to get the results in GB's.

I try several statements in different ways, but it is giving me every time
the same answer, namely: 84.00, but the answer should be 86653/1024=84.62.

Tried the following statements:
select SUM(A2.backup_mb)/1024 as "MB_Backup_WinNT" from nodes A1, auditocc
A2 where A1.node_name=A2.node_name AND A1.platform_name='WinNT'

select cast(SUM(A2.backup_mb)/1024 as decimal(8,2))as "MB_Backup_WinNT" from
nodes A1, auditocc A2 where A1.node_name=A2.node_name AND
A1.platform_name='WinNT'

Is there some SQL-guru out there, who can give me the tip to get my results
in GB's round in right way and two decimals ?

Thank you very much.

Brian


_________________________________________________________________
Download MSN Explorer gratis van http://explorer.msn.nl/intl.asp.

Reply via email to