Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Select Distinct (was top N or rewriting MAX)

Re: Select Distinct (was top N or rewriting MAX)

From: Roger Wernersson <roger.wernersson_at_adra.se>
Date: 1997/01/20
Message-ID: <32E35FAB.77F8@adra.se>#1/1

Jim Smith wrote:
>
> In article <32DEC3C1.7393_at_rci.rogers.com>, AWILSON
> <awilson_at_rci.rogers.com> writes
> >
> >How does Select Distinct work - ie what mechanism does it use to ensure
> >distinctness?
> It sorts the results and then does a table scan of the sorted set
> returning distinct rows. It may be able to use an index to achieve the
> same result, but in either case the ordering of the result is an
> accident.
>
> >Can it be relied upon to work the same way in future?
> >
> The safe answer is no, but I can't think of any mechanisms which would
> not result in a sorted set. Any clever computer science types out there
> who know of ways to achieve this?
> --
> Jim Smith

I think we can be quite sure of a sorted return BUT you may not be able to rely on whether it is sorted ascending or descending.

-- 
Sport radio: people listening to people watching people having fun
Mailto:roger.wernersson_at_adra.se
BTW: All opinions are mine, all mine, and nobody's but mine.
Received on Mon Jan 20 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US