Search Postgresql Archives

Re: Getting a sample data set.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx
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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux