Hi All,
Are there any SQL gurus you can help me out here?
I'm trying to write a script that prints NODE_NAME, TOTAL_GIGABYTES,
NUMBER_OF_FILES and TOTAL_TAPES all in one line.
Here is what I have so far:-
UPDATE SCRIPT Q_NODE_OCCUPANCY4 'select -'
UPDATE SCRIPT Q_NODE_OCCUPANCY4 ' node_name as NODE, -'
UPDATE SCRIPT Q_NODE_OCCUPANCY4 ' cast(sum(logical_mb)/1024 as integer) as
TOTAL_GIGABYTES, -'
UPDATE SCRIPT Q_NODE_OCCUPANCY4 ' sum(num_files) as NUMBER_OF_FILES, -'
UPDATE SCRIPT Q_NODE_OCCUPANCY4 ' (select distinct count(volume_name) from
volumeusage where occupancy.node_name = volumeusage.node_name) as NUMBER_OF_TAPES -'
UPDATE SCRIPT Q_NODE_OCCUPANCY4 ' from occupancy -'
UPDATE SCRIPT Q_NODE_OCCUPANCY4 ' group by node_name -'
UPDATE SCRIPT Q_NODE_OCCUPANCY4 ' order by NUMBER_OF_TAPES desc'
Unfortunately it returns the same NUMBER_OF_TAPES for all nodes. The total is
actually the one for the first node. How can I get the SQL to calculate this for every
node?
BTW: Getting rid of the ORDER BY doesn't help.
BTW#2: TSM (under Solaris 2.6) - Version 4, Release 1, Level 2.0
Regards
Andrew Webster
Deutsche Bank, Australia
Office : +61 3 9270-4229
Mobile : +61 (0) 4090 6515
Fax: +61 3 9270-4144
E-Mail : [EMAIL PROTECTED]
--
This e-mail may contain confidential and/or privileged information. If you are not the
intended recipient (or have received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorised copying, disclosure or
distribution of the material in this e-mail is strictly forbidden.