On Wed, 20 Sep 2000, Daniel Swan/TM wrote:
// Brian, my ADSM server choked on your SQL statement... it didn't like the
// "as". However, I did work this out on my own:
//
// select node_name, sum(capacity * (PCT_UTIL/100)) from filespaces group by
// node_name
//
// It works the way I want it to, but I'd like to round the result... I tried a
// few obvious syntaxes, but no dice. Any suggestions?
//
Daniel, try this:
select node_name, cast(sum(capacity * (PCT_UTIL/100))as decimal (yy,z)) as
percent_utilized from filespaces group by node_name
where yy is the max number of places to the left of the decimal point, z
is the number of places to the left. Note that places to the right are
padded with zeros, places to the left are not.
// Daniel Swan
// HP Unix Team
// ISM-BC
// 3030 2nd Ave SE
// Calgary, AB, T2A 5N7
// ph. 403-530-1726
// fax: 403-530-1066
//
//
//
//
// > -----Original Message-----
// > From: Johnson, Brian [SMTP:BrJohnson AT EXCHANGE.ML DOT COM]
// > Sent: Wednesday, September 20, 2000 10:23 AM
// > To: ADSM-L AT VM.MARIST DOT EDU
// > Subject: Re: Another ADSM capacity question
// >
// > You could try,
// >
// > select node_name, sum(physical_mb), as DATA_IN_MB, sum(num_files) from
// > occupancy group by node_name order by node_name
// >
// >
// > Brian Johnson
// > Merrill Lynch
// >
// > 212-647 3557
// >
// >
//
-
Best regards,
Best regards,
Brian
+-----------------------------------------------------------------------+
| Brian T. Huntley Systems and Network Engineer |
| Campus Information Services, Clarkson University |
| Ph/FAX: 315.268-6723/6570 |
| bth AT clarkson DOT edu www.clarkson.edu/cis |
+-----------------------------------------------------------------------+
UNIX *is* user friendly. It's just selective about who its friends are.
PGP Public Key available. finger bth AT clarkson DOT edu
|