Re: SQL Query

From: Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr>
To: Steve Grey <stevegrey78(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Ashish Karalkar <ashish_postgre(at)yahoo(dot)co(dot)in>, "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Subject: Re: SQL Query
Date: 2007-12-05 14:36:05
Message-ID: 20071205143605.GA17215@nic.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 05, 2007 at 11:43:08AM +0000,
Steve Grey <stevegrey78(at)gmail(dot)com> wrote
a message of 153 lines which said:

> First work out the maximum number of times each value of X will occur in the
> table

A better solution, when you do not know this maximum number, is CREATE
AGGREGATE (http://www.postgresql.org/docs/8.1/interactive/xaggr.html)
See details :

http://www.bortzmeyer.org/agregats-postgresql.html

(Yes, it is in french but the SQL examples are in english, variable
names included, so they still can be useful for the OP).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-12-05 14:39:29 Re: Moving pgstat.stat and pgstat.tmp
Previous Message Paul Boddie 2007-12-05 14:15:46 Re: Deadlock when updating table partitions (and presumed solution)