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: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: 1997/01/19
Message-ID: <Z3xyZAA5+h4yEwhi@jimsmith.demon.co.uk>#1/1

In article <32DEC3C1.7393_at_rci.rogers.com>, AWILSON <awilson_at_rci.rogers.com> writes
>Pardon my jumping in again,
>
>This raises a couple of interesting points.
>
>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
Received on Sun Jan 19 1997 - 00:00:00 CST

Original text of this message

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