From: | "Chad Thompson" <chad(at)weblinkservices(dot)com> |
---|---|
To: | "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>, "Rudi Starcevic" <rudi(at)oasis(dot)net(dot)au>, <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: DISTINCT ON |
Date: | 2002-09-13 14:35:39 |
Message-ID: | 009e01c25b32$d57ac340$32021aac@chad |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
According to a recent thread Re: [SQL] Select the max on a field
Jeff Eckerman said:
>If you don't mind a non-portable feature, DISTINCT ON
>should do what you want. Something like:
>SELECT DISTINCT ON (att_2) att_1, att_2, att_3, att_4
>FROM table
>ORDER BY att_2, att_1 DESC;
I couldnt find anything in the docs, but it acording to this it isnt standard
Thanks
Chad
----- Original Message -----
From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Rudi Starcevic" <rudi(at)oasis(dot)net(dot)au>; <pgsql-sql(at)postgresql(dot)org>
Sent: Thursday, September 12, 2002 8:48 PM
Subject: Re: [SQL] DISTINCT ON
> Don't know. I've seen it elsewhere so it might even be "standard".
>
> Chris
>
> > -----Original Message-----
> > From: pgsql-sql-owner(at)postgresql(dot)org
> > [mailto:pgsql-sql-owner(at)postgresql(dot)org]On Behalf Of Rudi Starcevic
> > Sent: Friday, 13 September 2002 10:50 AM
> > To: pgsql-sql(at)postgresql(dot)org
> > Subject: [SQL] DISTINCT ON
> >
> >
> > Hi,
> >
> > Just quickly, DISTINCT ON - Is that Postgresql only ?
> > Thanks
> >
From | Date | Subject | |
---|---|---|---|
Next Message | Florian Mader | 2002-09-13 14:38:50 | Timestamp Fractions Problem |
Previous Message | Manfred Koizar | 2002-09-13 12:46:05 | Re: Table alias in DELETE statements |