Re: Returning Rows in Random Order

From: John Russell <johnrussell10_at_home.com>
Date: Fri, 09 Mar 2001 08:43:07 GMT
Message-ID: <5k5hatc4gptvmh4ctidttjmdq9bplrnvf6_at_4ax.com>


There is the DBMS_RANDOM package that you can use to get a random number. See:

http://tahiti.oracle.com/pls/tahiti/tahiti.drilldown?word=dbms_random&book=&preference=&method=LIKE

I haven't tried using the result of DBMS_RANDOM.RANDOM in an ORDER BY clause, but it is used to randomize the search tip on the above page. :-)

John

On Wed, 7 Mar 2001 15:24:13 +0100, "jack straw" <sacque_at_yahoo.com> wrote:

>well, there is an index unfortunately :(
>
>"Happl Oberlin" <happl_at_mail.com> wrote in message
>news:happl-F778E4.14173507032001_at_news.fu-berlin.de...
>> In article <985a58$kl9$1_at_linux1.netconx.de>, "jack straw"
 <sacque_at_yahoo.com> wrote:
>>
>> >Is there a way to return rows from a SELECT statement in a random order?
>> >I have found ways to do it in SQL server, but not in Oracle.
>>
>> If there is no ORDER BY or GROUP BY in the query and
>> ORACLE does not use an index to retrieve the data,
>> the rows are returned in random order.
>>
>> Greetings from Switzerland -- Gruesse aus der Schweiz
>> Happl
>

Got an Oracle database question?
Try the search engine for the database docs at: http://tahiti.oracle.com/ Received on Fri Mar 09 2001 - 09:43:07 CET

Original text of this message