ADSM-L

Re: Select for Scratches

2002-09-19 20:08:10
Subject: Re: Select for Scratches
From: "Seay, Paul" <seay_pd AT NAPTHEON DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 19 Sep 2002 20:06:17 -0400
Sorry, wrong select
Why does this one not give the correct answer?

Select library_name, count(*) from libvolumes where status='Scratch' group
by library_name

Paul D. Seay, Jr.
Technical Specialist
Naptheon Inc.
757-688-8180


-----Original Message-----
From: Lars Bebensee [mailto:LBebensee AT HAITEC DOT DE]
Sent: Thursday, September 19, 2002 5:35 AM
To: ADSM-L AT VM.MARIST DOT EDU
Subject: Select for Scratches


Hi folks,

I am not that good with select queries yes, so I will have to ask one of the
SQL gurus here: we wanted to show how many scratch tapes each library has
with a query like
this:

"select a.library_name,count(*) as volumes, b.devtype from libvolumes as a,
devclasses as b where upper(status) like 'SCRATCH%' and a.library_name='$i'
and a.library_name=b.library_name group by a.library_name,b.devtype"

$i will be filled with the name of the library before. The funny thing, it
shows exactly as twice as many scratches. Is there someone amongst you who
can exctract this little monster for me and show me what I am doing wrong.

Thanks for helping out

Lars

<Prev in Thread] Current Thread [Next in Thread>