List:General Discussion« Previous MessageNext Message »
From:Darren L Sweeney Date:May 14 1999 5:01pm
Subject:RE: order by random?
View as plain text  
one way to do this would be to add a new column which simply adds a random
number on any insert into the table(easy if you are using perl for example
to do the insert)

if you then did a select and sort by the random number solumn you would have
the appearance of a random select

just an idea ....

rgds

darren

> -----Original Message-----
> From:	Sasha Pachev [SMTP:sasha@stripped]
> Sent:	Friday, May 14, 1999 12:38 PM
> To:	Chris Nuccitelli
> Cc:	mysql@stripped
> Subject:	Re: order by random?
> 
> Chris Nuccitelli wrote:
> > 
> > Just a quick question, maybe I'm missing something obvious....
> > 
> > Is it possible to select rows from a table in *random* order, rather
> than
> > simply ascending or descending?
> > 
> > ---
> >  _   /|   |  slothdog -- Chris Nuccitelli
> >  \'o.O'   |  http://chris.vsnet.com/
> >  =(___)=  |  ICQ: 1124216
> >     U
> > 
> 
> I do not think so. However, if you need to select them
> in random order, introduce some randomization in you
> code when you deliver the query results.
> 
> -- 
> Sasha Pachev
> http://www.sashanet.com/ (home)
> http://www.direct1.com/ (work)
> 
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread3383@stripped
> 
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.
Thread
order by random?Chris Nuccitelli14 May
  • Re: order by random?Sasha Pachev14 May
RE: order by random?Darren L Sweeney14 May