Well,
I tried to use the ORDER BY RND() function in the SQL statement, but it gave
me 1 random result everytime (shuffled the results but allways the same
way).
So I tried a CFTAG CF_SHUFFLE which I used with a list, but can be used
witha query result. There are a number of parameters you can feed it, on
being the RandomSeed. Again, a nice shuffle but the same shuffle every time.
What did work was passing a different RandomSeed, seconds or milliseconds
would work, I used #RandRange(1, 99)#.
Seems to give a good result, however if you set the seed range to low, you
can begin to detect a pattern.
Thanks all for the advice,
Brian.
----- Original Message -----
From: "Brian Hogue" <[EMAIL PROTECTED]>
To: "SQL" <[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 3:33 PM
Subject: Re: [Fw: order by random]
> Daniel -
>
> There were some articles on this a few years ago. Most Random functions
are not really random. The sequence is so
> long that it appears random to most people.
>
> It sounds like your issue is that seed, or the starting point, is always
the same. Try using the seconds or
> milliseconds of the current time as the seed. That is what many seeds used
to use.
>
> -brian
>
>
> Daniel Lancelot wrote:
>
> > I tried to do something similar in SQL, but found that the rnd()
function is
> > not random enough - I.E. they were ordered in the same order each time.
I
> > also tried using getdate() as the seed, but as the whole query ran
within 1
> > ms, the results were still not random.
> >
> > If anyone has done this sucessfully (i.e - different results each time
they
> > run) I would be interested...
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists