You could create a sequence and assign each record a value and then generate
a random list of sequence numbers. However, that would mean multiple
selects to ensure they would come out in "random" order.
(Unless you specify an order, records are not necessarily guaranteed to come
out in the same order each time, though the will tend to because of the
processes involved.)
-----Original Message-----
From: Steve Sapovits [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 15:58
To: DBI List (E-mail)
Subject: Fetching rows randomly
Does any know of a way, either directly through Oracle
using SQL, or in conjunction with DBI to have rows returned
in a random order? The problem to solve is this: We fetch
similar result sets across several queries, but we want the
resulting output order to be different.
The data sets are large, so randomizing in memory is not a
viable option. I'd like to just affect the fetch somehow.
Rewriting the query in PL/SQL is also not desired.
It would seem that if I could get at the underlying result set
before the first fetch I could do something here ... but that
seems like a real violation of interface.
----
Steve Sapovits
Global Sports Interactive
Work Email: [EMAIL PROTECTED]
Home Email: [EMAIL PROTECTED]
Work Phone: 610-491-7087
Cell: 610-574-7706
Pager: 877-239-4003