X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C9892474E5C for ; Sat, 1 Mar 2003 12:08:51 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 14753-10 for ; Sat, 1 Mar 2003 12:08:50 -0500 (EST) Received: from jester.inquent.com (CPE00508b028d7d-CM00803785c5e0.cpe.net.cable.rogers.com [24.103.51.175]) by postgresql.org (Postfix) with ESMTP id 541B0474E42 for ; Sat, 1 Mar 2003 12:08:50 -0500 (EST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by jester.inquent.com (8.12.6/8.12.6) with ESMTP id h21H74vD028565; Sat, 1 Mar 2003 12:07:05 -0500 (EST) (envelope-from rbt@rbt.ca) Subject: Re: Denormalizing during select From: Rod Taylor To: Edmund Lian Cc: pgsql-sql@postgresql.org In-Reply-To: References: <200302241433.49502.josh@agliodbs.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Ua0c/hrkv3DXna4JFh1h" Organization: Message-Id: <1046538423.26763.177.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 01 Mar 2003 12:07:04 -0500 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/12 X-Sequence-Number: 12052 --=-Ua0c/hrkv3DXna4JFh1h Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2003-02-25 at 13:48, Edmund Lian wrote: > On Tue, 25 Feb 2003 03:44:02 GMT, Edmund Lian wrote: >=20 > >I found this example in "Practical PostgreSQL"... will it do the job? >=20 > Answering my own question: kind of. The problem with custom aggregates > is that they need to be used with a "group by" clause, and this means > that the select cannot return columns that are not aggregates of some > kind. What I'm trying to return are rows that are a combination of > columns and aggregates. I've been trying to figure out how to give a running total (similar issue I think). key value 1 5 1 5 1 5 2 1 2 2 2 1 Query output: key value sum to point 1 5 5 1 5 10 1 5 15 2 1 1 2 2 3 2 1 4 I think I should be able to do it with an aggregate -- but the best I've been able to come up with is a Set Returning Function. --=20 Rod Taylor PGP Key: http://www.rbt.ca/rbtpub.asc --=-Ua0c/hrkv3DXna4JFh1h Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+YOi36DETLow6vwwRAg07AJ9rJhfWoxsPnhKQDxji60sZCsFfTQCfcgDH hklbDKBIm43clT8CKPxp98o= =ADgy -----END PGP SIGNATURE----- --=-Ua0c/hrkv3DXna4JFh1h--