Matthew, Your "as" should be outside the parentheses because you want it as part of the final query, not as part of the subquery. The renaming won't carry outside the subquery if you put it inside the parentheses. Also, try using double quotes instead of single quotes. The following worked for me:
select db.pct_utilized,log.pct_utilized,(select count(*) from volumes where access='READONLY') as "READONLY", (select count(*) from volumes where access='UNAVAILABLE') as "UNAVAILABLE" from db,log Alex Paschal Storage Administrator Freightliner, LLC (503) 745-6850 phone/vmail -----Original Message----- From: Warren, Matthew James [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 5:45 AM To: [EMAIL PROTECTED] Subject: Re: Logmode rollforward and incr/full dbbackups Hello TSM'ers I am trying to run the following simple SQL query select db.pct_utilized,log.pct_utilized,(select count(*) from volumes where access='READONLY'),(select count(*) from volumes where access='UNAVAILABLE') from db,log The above works fine, but if I add 'as' into it like so; select db.pct_utilized,log.pct_utilized,(select count(*) as 'READONLY' from volumes where access='READONLY'),(select count(*) as 'UNAVAILABLE' from volumes where access='UNAVAILABLE') from db,log I get an unexpected literal SQLtoken. Am I worng in how I am writing the 'as' statements? Also, if I extend the top command to read select db.pct_utilized,log.pct_utilized,(select count(*) from volumes where access='READONLY'),(select count(*) from volumes where access='UNAVAILABLE'),(select count(*) from volumes where access='UNAVAILABLE') from db,log (the last bracketed select is simply repeated again) I get nothing but a return code 3 from TSM. Am I wildy innacurate with my SQL selects, or are there some 'odd limitations' to TSM's pseudo-select queries. Thanks, Matt.