Re: Picking a random row
Date: 1997/11/21
Message-ID: <6554tv$qu5$1_at_tor-nn1.netcom.ca>#1/1
Agreed it might be inefficient, but if we don't want to add new table elements, we might be limited ? No?
The other items I could think of might (repeat might) be the use of the
rowid somehow?
Or if there is some item that might be unique and it's in some sort of
range, you might want to try and write some code that would generate a
random number between (x) and (y) and then do a 'select count(*) from table
where <unique_key> = <random number>'.
Put this in some loop and if the item is not found, generate a new random number?
Sorry, I'm out of idea's, if you do manage to resolve this issue, please be sure to let me know. I'm not certain if anyone else out in cyberspace is interested, but I'd like to know.
Regards, Dave
Roy Smith wrote in message ...
>"Dave S." <daves_at_nospam.com> wrote:
>
>> Then you could loop through this kind of select statement until you have
>> selected enough rows?
>>
>> Would this not suffice?
>
>Oh, god, no. The table has 600,000 rows. I would work, sure, but it
>would be hideously inefficient.
>
>--
>Roy Smith <roy_at_popmail.med.nyu.edu>
>New York University School of Medicine
>550 First Avenue, New York, NY 10016
>
Received on Fri Nov 21 1997 - 00:00:00 CET