Re: Getting a sample data set. - Mailing list pgsql-general

From James B. Byrne
Subject Re: Getting a sample data set.
Date
Msg-id 43506.216.185.71.25.1295377152.squirrel@webmail.harte-lyne.ca
Whole thread Raw
In response to Re: Getting a sample data set.  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Responses Re: Getting a sample data set.
List pgsql-general
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


pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: PgEast: 2011, 2nd call for papers
Next
From: Jeff Davis
Date:
Subject: Re: Need help writing exclusion constraint