"Ben Gollmer" <[EMAIL PROTECTED]> wrote:
> I've got a better way yet:
>
> select RAND() as rand_col, column_name from table_name order by rand_col
Ben, you must have overlooked David Robley's reply and my confirmation that
his idea does indeed work (which was in the email you responded to). Davi
I've got a better way yet:
select RAND() as rand_col, column_name from table_name order by rand_col
Only one query for randomized results, no PHP/Perl/etc. You can of course
add the 'limit 1' on the end to get one row back. I use this method a lot -
my main server is running 3.22.32 but my tes
"David Robley" <[EMAIL PROTECTED]> wrote:
> On Wed, 7 Feb 2001 11:28, enthalpy wrote:
> > anyone have example code for randomly grabing an item from a mysql
table?
> >
>
> Mysql 3.23 will let you order by RAND() and you could use a LIMIT to
> restrict to one result. I haven't tried it, though.
I
On Wed, 7 Feb 2001 11:28, enthalpy wrote:
> anyone have example code for randomly grabing an item from a mysql table?
>
Mysql 3.23 will let you order by RAND() and you could use a LIMIT to
restrict to one result. I haven't tried it, though.
--
David Robley| WEBMASTER &
4 matches
Mail list logo