On Tue, January 18, 2011 13:23, Alban Hertroys wrote:
>
>
> Standard SQL alternatives tend to get complex, using self-joins to
> weed out all the records you don't want (the exact term for such
> joins escapes me right now, that would help with Googling if you're
> looking for examples).
Would the term be a grouped self join?
> Basically you do something like:
> SELECT s1.mode
> FROM shipments AS s1
> WHERE NOT EXISTS (
> SELECT NULL
> FROM shipments AS s2
> WHERE s1.mode = s2.mode
> AND s1.somecolumn < s2.somecolumn
> )
>
I can see the motivation for something like DISTINCT ON. I take it
that this syntax is peculiar to PostgreSQL?:
--
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3