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 JAA29906 for postgres-dist; Tue, 7 Dec 1993 09:55:02 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199312071755.JAA29906@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 localhost (aoki@localhost) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) id JAA29894; Tue, 7 Dec 1993 09:55:01 -0800
Message-Id: <199312071755.JAA29894@nobozo.CS.Berkeley.EDU>
From: aoki@postgres.Berkeley.EDU (Paul M. Aoki)
To: Brian Holman <bkh@liblas.byu.edu>
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: summing numerical fields in a class 
In-reply-to: Your message of Tue, 7 Dec 1993 08:13:53 +119303928 (MST) 
	     <9312071513.AA04263@liblas.byu.edu> 
Date: Tue, 07 Dec 1993 09:55:01 -0800
X-Sender: aoki@postgres.Berkeley.EDU
Resent-To: postgres-dist@postgres.Berkeley.EDU
Resent-Date: Tue, 07 Dec 93 09:55:02 -0800
Resent-XMts: smtp

Brian Holman <bkh@liblas.byu.edu> writes:
> retrieve (
>    total = sum {TIMESTAT.time where TIMESTAT.date >= "Dec 01 1993" 
>    and TIMESTAT.date <= "Dec 31 1993"}
> )

actually, this is one of the very few types of aggregate queries
that DOES work somewhat reliably (aggregate with one variable in
the target list).

the only kicker here is that a sum aggregate for reltime is not
installed by default, so you would have to either use int4 or
define one yourself.
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki
