Re: distinct on

  • From: "Jonathan Lewis" <jonathan@xxxxxxxxxxxxxxxxxx>
  • To: <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 18 Oct 2012 08:36:20 +0100


Thomas,

Just to avoid any confusion - is your response about the Postgres on() 
clause example that we saw, or are you talking about the analytic function 
implementation in Oracle.  The latter is something I know, the former is 
what I was curious about - especially since (possibly coincidentally) the 
selected "b column" value in the example happened to be the middle (both in 
value and position) of the original list. If your reply was related to 
Postgres - can you give us a version of the Postgres example that shows the 
"order by" in place.

Thanks

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

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

----- Original Message ----- 
From: "Thomas Kellerer" <thomas.kellerer@xxxxxxxxxx>
To: <oracle-l@xxxxxxxxxxxxx>
Sent: Thursday, October 18, 2012 8:05 AM
Subject: Re: distinct on


| Jonathan Lewis, 18.10.2012 08:57:
| >
| > How does the Postgres specification define the requirements for the 
columns
| > other than the on() column ?
| >
|
| It uses the ordering defined by the ORDER BY if there is one, otherwise 
it's undefined:
|
| From the manual:
|   "Note that the "first row" of each set is unpredictable unless ORDER BY 
is used to ensure that the desired row appears first"
|

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


Other related posts: