Re: distinct on

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Thu, 18 Oct 2012 07:57:12 +0100
Message-ID: <912D63A91F2F4A508D18F63DB11ECFA0_at_Primary>


How does the Postgres specification define the requirements for the columns other than the on() column ?

Is it "one row at (pseudo-)random from all the rows which match this specific value of the on() column", or is there any indication that the other columns could ALL be chosen randomly so that the output wasn't a row that actually existed, or is there any indication that the result will be deterministic in a particular way ?

Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com/all_postings

Author: Oracle Core (Apress 2011)
http://www.apress.com/9781430239543

  • Original Message ----- From: "jo" <jose.soares_at_sferacarta.com> To: "ORACLE-L" <oracle-l_at_freelists.org> Sent: Thursday, October 18, 2012 7:38 AM Subject: distinct on

|I found an interesting non standard feature in postgres to distinguish
| one column in a query.
| How can I do this in Oracle?
|
|
| select distinct on(a) * from test;
| a | b
| ----+-----
| a | bb
| aa | bbb
| ab | bbb
| (3 rows)
|

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Oct 18 2012 - 08:57:12 CEST

Original text of this message