pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephane Bortzmeyer <bortzmeyer@nic.fr>
To: Steve Grey <stevegrey78@gmail.com>
Cc: pgsql-general@postgresql.org
Cc: Ashish Karalkar <ashish_postgre@yahoo.co.in>
Cc: A. Kretschmer <andreas.kretschmer@schollglas.com>
Subject: Re: SQL Query
Date: Wed, 5 Dec 2007 15:36:05 +0100
Message-ID: <20071205143605.GA17215@nic.fr> (raw)
In-Reply-To: <c0c351c40712050343r12ba7a6fnb8f1fefe718f432@mail.gmail.com>
References: <20071205103548.GD24799@a-kretschmer.de>
	<33481.2408.qm@web94314.mail.in2.yahoo.com>
	<c0c351c40712050343r12ba7a6fnb8f1fefe718f432@mail.gmail.com>

On Wed, Dec 05, 2007 at 11:43:08AM +0000,
 Steve Grey <stevegrey78@gmail.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).



view thread (45+ messages)  latest in thread

Message-ID: <20071205143605.GA17215@nic.fr>
Permalink:  ../20071205143605.GA17215@nic.fr/
Also on:    postgresql.org/message-id/20071205143605.GA17215@nic.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: bortzmeyer@nic.fr, stevegrey78@gmail.com, ashish_postgre@yahoo.co.in, andreas.kretschmer@schollglas.com
  Subject: Re: SQL Query
  In-Reply-To: <20071205143605.GA17215@nic.fr>
  References: <20071205103548.GD24799@a-kretschmer.de> <33481.2408.qm@web94314.mail.in2.yahoo.com> <c0c351c40712050343r12ba7a6fnb8f1fefe718f432@mail.gmail.com> <20071205143605.GA17215@nic.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox