ADSM-L

Re: Nested select

2005-02-11 05:40:02
Subject: Re: Nested select
From: "Das, Samiran (IDS ECCS)" <samiran_das AT ML DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Fri, 11 Feb 2005 05:39:52 -0500
Tomas,

The following select statement will give you exactly what you want.

select node_name as NODENAME,sum(case when substr(stgpool_name,1,1) in ('T') 
then logical_mb else 0 end) as PRIMARY_OCC,sum(case when 
substr(stgpool_name,1,1) in ('C') then logical_mb else 0 end) as COPY_OCC from 
occupancy group by node_name

Regards, Samiran Das


-----Original Message-----
From: ADSM: Dist Stor Manager [mailto:ADSM-L AT VM.MARIST DOT EDU] On Behalf Of 
Tomáš Hrouda
Sent: Friday, February 11, 2005 5:19 AM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Nested select


Hi all,

I have problem with select command, maybe SB had solve similar problem 
sometimes. What I need to do: select from occupancy table where I want to have 
on ONE row : 1st column - nodename 2nd column - sum logical_mb accross stgpools 
like "T%" (primary pools) for this node 3rd column - sum logical_mb accross 
stgpools like "C%" (copy pools) for this node

I think this is example for application of nested select commands and I know, 
that TSM DB selects are reduced set of SQL92 and SQL93 standard. I was not able 
to collect appropriate command, so I want to ask anybody, if is it ever 
possible in TSM to do that.

Any idea will be appreciated.

Regards
Tomas Hrouda
Storage Specialist
HTD s.r.o. Praha
CZECH REPUBLIC
throuda AT htd DOT cz
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Click here for important additional terms relating to this 
e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>
  • Nested select, Tomáš Hrouda
    • Re: Nested select, Das, Samiran (IDS ECCS) <=