ADSM-L

[ADSM-L] "group by" assistance.

2009-10-21 17:22:51
Subject: [ADSM-L] "group by" assistance.
From: Shawn Drew <shawn.drew AT AMERICAS.BNPPARIBAS DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Wed, 21 Oct 2009 17:20:02 -0400
I'm having some trouble with the group by clause.  It seems I can't group
data that has been "cast"ed

First start with:
select cast((bytes/1024/1024/1024) as decimal(8,2)) AS "GB", cast(end_time
as date) as "Date" from summary where activity='STGPOOL BACKUP'

                          1794.26     2009-10-19
                          1026.27     2009-10-19
                          1371.60     2009-10-20
                          1524.60     2009-10-20
                          1053.99     2009-10-21
                          1755.08     2009-10-21

As expected, it shows one line per process.  I would like to group these
by the date so we have a total amount of Gigabytes per day.
But when I add the "sum" and "group by" clauses, it doesn't change the
output:

select sum(CAST((bytes/1024/1024/1024) as decimal(8,2))) AS "GB",
cast(end_time as date) as "Date" from summary where activity='STGPOOL
BACKUP' group by end_time

                          1794.26     2009-10-19
                          1026.27     2009-10-19
                          1371.60     2009-10-20
                          1524.60     2009-10-20
                          1053.99     2009-10-21
                          1755.08     2009-10-21


Also, it doesn't let me group by "Date".  It needs to be grouped by the
"end_time"
Any ideas to produce what I'm looking for?


TSM 5.5.3 on AIX 6.1


Regards,
Shawn
________________________________________________
Shawn Drew
Data Protection Engineer
Core IT Production
BNP Paribas RCC, Inc.
Office:   201.850.6998
Mobile: 917.774.8141


This message and any attachments (the "message") is intended solely for
the addressees and is confidential. If you receive this message in error,
please delete it and immediately notify the sender. Any use not in accord
with its purpose, any dissemination or disclosure, either whole or partial,
is prohibited except formal approval. The internet can not guarantee the
integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will)
not therefore be liable for the message if modified. Please note that certain
functions and services for BNP Paribas may be performed by BNP Paribas RCC, Inc.