Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id HAA28715 for postgres-dist; Tue, 7 Dec 1993 07:12:53 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199312071512.HAA28715@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from liblas.byu.edu (liblas.byu.edu [128.187.11.118]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id HAA28706 for <postgres@nobozo.CS.Berkeley.EDU>; Tue, 7 Dec 1993 07:12:52 -0800
Received: by liblas.byu.edu; id AA04263; Tue, 7 Dec 1993 08:13:54 -0700
From: Brian Holman <bkh@liblas.byu.edu>
Message-Id: <9312071513.AA04263@liblas.byu.edu>
Subject: summing numerical fields in a class
To: postgres@postgres.Berkeley.EDU
Date: Tue, 7 Dec 1993 08:13:53 +119303928 (MST)
X-Mailer: ELM [version 2.4 PL22]
Content-Type: text
Content-Length: 1248      
Resent-To: postgres-dist@postgres.Berkeley.EDU
Resent-Date: Tue, 07 Dec 93 07:12:53 -0800
Resent-XMts: smtp

I am writing a program that executes a child process and monitors the number
of real time seconds the child is "active".  After the child has terminated
it then records the following in the TIMESTAT class:

appl = text
time = reltime
status = char
date = abstime

where a typical entry would be:

append (
   appl = "BYLINE", time = "@ 1251 seconds", status = 'O', date = "Dec 7 1993"
)

I would like to do the following query:

retrieve (
   total = sum {TIMESTAT.time where TIMESTAT.date >= "Dec 01 1993" 
   and TIMESTAT.date <= "Dec 31 1993"}
)

I am using Postgres 4.1 on a DECStation running Ultrix 4.2A.  The above
mentioned query would be considered an aggregate and therefore is not yet a
supported feature.  Does anyone have any ideas how I can get around this
limitation.  Any thoughts on the subject would be greatly appreciated.
-- 
+--------------------------+-------------------------------------+
| BRIAN K. HOLMAN          | E-Mail:        brian_holman@byu.edu |
| Programmer/Analyst       | Mail:    2330 HBLL, Provo, UT 84602 |
| Library Automations      | Phone:               (801) 378-8162 |
| Brigham Young University | Fax:                 (801) 378-3221 |
+--------------------------+-------------------------------------+
