I believe the following will work in Access/Jet. There's no doubt a similar
function in SQL or other DBs.
SELECT *
FROM mytable
WHERE mycolumn = '#myvalue#'
ORDER BY Rnd(mytableid)
Use any numeric field in the Rnd() function, but a numeric primary key is
ideal.
Jim
----- Original Message -----
From: "Javier Woodhouse" <[EMAIL PROTECTED]>
To: "CF-Server" <[EMAIL PROTECTED]>
Sent: Monday, April 09, 2001 6:13 PM
Subject: RE: order by random
> I had to do this and the only thing i could figure out was to create 5
> columms wich i updated regularly and would order by one of the five -
chosen
> at random... the columns themselves contained random numbders...
>
> That's about as close as i could come.. Hope it helps
>
> > -----Original Message-----
> > From: Tony [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, April 09, 2001 6:24 PM
> > To: CF-Server
> > Subject: order by random
> >
> >
> > Hello Everyone,
> >
> > Is there a way to sort a column in random order? I thought
> > something like:
> >
> > SELECT * FROM MyTable
> > WHERE
> > MyVariable='#myvalue#'
> > ORDER BY RANDOM
> >
> > would output something like
> >
> > 1
> > 2
> > 3 the first time
> >
> > and then
> >
> > 1
> > 3
> > 2 (varying in order)
> >
> > but all it does is say error... If there isn't a way built
> > into cf/sql to do this does someone have their own method
> > that they'd be willing to share?
> >
> > Thanks,
> > Tony Hicks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com