Re: Returning Rows in Random Order

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Wed, 07 Mar 2001 18:32:10 +0800
Message-ID: <3AA60E2A.11CA_at_yahoo.com>


jack straw 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

select col1, col2, random_number_function from table
order by 3

or take a look at the SAMPLE clause

hth
Connor

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk (mirrored at
http://www.oradba.freeserve.co.uk)

"Some days you're the pigeon, some days you're the statue"
Received on Wed Mar 07 2001 - 11:32:10 CET

Original text of this message