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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Returning Rows in Random Order

Re: Returning Rows in Random Order

From: Ian Ledzion <ian.ledzion_at_xlgbow.com>
Date: Thu, 8 Mar 2001 11:20:05 +0100
Message-ID: <987mcd$8nj$1@rex.ip-plus.net>

Check out the DBMS_RANDOM package. You could do a sub-query returning a column with random numbers in it, and then ORDER BY on that column.

But as William said.... Why?

"William Bailey" <billbailey64_at_netzero.net> wrote in message news:VnBp6.3263$68.713600_at_typhoon.tampabay.rr.com...
> Technically, SQL always returns rows in a random order ... i.e. there is
 no
> guarantee what order they will be returned in ... this is why ORDER BY is
> required if you want a specific order. So what I suppose you mean is that
> you want the rows to be returned in a different order each time you select
> from the table ... as far as I'm aware, there is no way to do this in
 Oracle
> ... the rows MAY be returned in a different order from one select to the
> next, but there is no way to guarantee it.
>
> I'm curious .. why in the world would you need to do this?
>
> "jack straw" <sacque_at_yahoo.com> wrote in message
> news:9859pv$kj0$1_at_linux1.netconx.de...
> > 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.
> >
> > please help!
> > thanks
> >
> >
> >
> >
>
>
Received on Thu Mar 08 2001 - 04:20:05 CST

Original text of this message

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