ADSM-L

Re: Sql problem

2002-04-12 07:31:17
Subject: Re: Sql problem
From: Zlatko Krastev <acit AT ATTGLOBAL DOT NET>
Date: Fri, 12 Apr 2002 13:42:06 +0300
There is a workaround the problem but it is ugly and can work for small
number of GROUP BY values.
Look for my post on the thread "SQL query - GROUP on derived value?" from 
25.09.2001.
The rough idea - create records somewhere they would not be a problem.
I've used CLIENT_SCHEDULES table with and empty policy domain for the
task. Join the tables and group by fake records.

Zlatko Krastev
IT Consultant



Please respond to "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
Sent by:        "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>
To:     ADSM-L AT VM.MARIST DOT EDU
cc:

Subject:        Sql problem

Hi All,

I just realized I can use the summary table to get tape mount stats.
However I can't get my sql to work
I'm trying
        select hour(end_time) as "Hour", count(*)
        from summary
        where activity= 'TAPE MOUNT'
                and date(end_time) = current date - 1 day
        group by hour(end_time)

and TSM is complaining about the group by clause.

ANR2904E Unexpected SQL key word token - 'HOUR'.

                                                          |
         .................................................V.............
         nd date(end_time) =current date - 1 day group by hour(end_time)

I've also tried 'group by 1' and 'group by "Hour"' but that doesn't work
either.

This is fairly standard SQL, anyone know what I'm doing wrong?


Steve Harris
AIX and TSM Administrator
Queensland Health, Brisbane Australia





**********************************************************************
This e-mail, including any attachments sent with it, is confidential
and for the sole use of the intended recipient(s). This confidentiality
is not waived or lost if you receive it and you are not the intended
recipient(s), or if it is transmitted/ received in error.

Any unauthorised use, alteration, disclosure, distribution or review
of this e-mail is prohibited.  It may be subject to a statutory duty of
confidentiality if it relates to health service matters.

If you are not the intended recipient(s), or if you have received this
e-mail in error, you are asked to immediately notify the sender by
telephone or by return e-mail.  You should also delete this e-mail
message and destroy any hard copies produced.
**********************************************************************
<Prev in Thread] Current Thread [Next in Thread>
  • Re: Sql problem, Zlatko Krastev <=