Re: distinct on

  • From: "Jonathan Lewis" <jonathan@xxxxxxxxxxxxxxxxxx>
  • To: "ORACLE-L" <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 18 Oct 2012 07:57:12 +0100

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@xxxxxxxxxxxxxx>
To: "ORACLE-L" <oracle-l@xxxxxxxxxxxxx>
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)
|

--
//www.freelists.org/webpage/oracle-l


Other related posts: