List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:May 18 1999 3:46pm
Subject:Re: random rows
View as plain text  
Xah Lee wrote:
> 
> Thanks Tschau Christian. The proposed solution works.
> 
> However, isn't there a proper method to get random rows? (instead of adding
> a 'random' column ad hoc to a table.)
> 
> Does SQL/92 specify a way to select rows randomly?
> 
> Xah
< cut >

Hi

On the mysql TODO list "F.2 Things that have to be done sometime":
Allow sorting on RAND(): 

     SELECT email,RAND() AS ran FROM info ORDER BY ran;

But this isn't standard SQL92.
SQL92 doesn't provide any syntax for 'random order'.
With SQL92 only, you have to generate the random values to fill the additional 'random'
column yourself!

Tschau
Christian

Thread
random rowsXah Lee15 May
Re: random rowsChristian Mack17 May
Re: random rowsXah Lee18 May
Re: random rowsChristian Mack18 May