Re: Getting a sample data set.

From: "James B(dot) Byrne" <byrnejb(at)harte-lyne(dot)ca>
To: "Alban Hertroys" <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Getting a sample data set.
Date: 2011-01-18 18:59:12
Message-ID: 43506.216.185.71.25.1295377152.squirrel@webmail.harte-lyne.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)Harte-Lyne(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2011-01-18 19:23:22 Re: Need help writing exclusion constraint
Previous Message Joshua D. Drake 2011-01-18 18:51:10 PgEast: 2011, 2nd call for papers