[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    Re: SQL question.... Trying to improve upon my PHP solution.
From:       mos <mos99 () fastmail ! fm>
Date:       2004-11-29 20:08:20
Message-ID: 6.0.0.22.2.20041129140803.02e25970 () mail ! messagingengine ! com
[Download RAW message or body]

At 11:53 AM 11/29/2004, you wrote:
>On 11/29/04 12:27 PM, "mos" <mos99@fastmail.fm> wrote:
>
> > Mike,
> >        Your solution is way too complicated (it makes my head hurt).<g>
> > Try this:
> >
> > set @n=0;
> > update tmp set rnd = @n := @n + 1 order by RAND()
> >
> > Mike
>
>I'll give this a shot. Follow-up question:
>
>I've had a lot of trouble with RAND() on my MySQL 3 box not being all that
>random. This time I'm using 4.0.17-log. Is it going to be any better?
>
>~ Mike

Mike,

According to http://dev.mysql.com/doc/mysql/en/News-4.0.1.html they've 
improved Rand in version 4.0.1 "Changed RAND() initialization so that 
RAND(N) and RAND(N+1) are more distinct. " and in 4.0.10 they "Fixed 
initialization of the random seed for newly created threads to give a 
better rand() distribution from the first call. "


Mike  


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=mysql@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic