>> In a slight change of this question (since I have no data to
>> currently test this with, as my ISP is using too old a
>> version of mysql), does anyone know what something like
>> this would do?
>> 
>> SELECT * FROM theTable ORDER BY RAND(), date LIMIT 5;
> 
> Exactly the same as SELECT * FROM theTable ORDER BY RAND() LIMIT 5; would
> do, since RAND() returns a different value for each row, and the date column
> would only be sorted in the event of duplicates in the previous order
> expression.

Gotcha.  So is there any way to return 5 (some number) rows, chosen
randomly, and then sort them by date (or name or whatever).  So the final
result is a list, sorted by date, but of rows chosen randomly from the
table.

I assume this would be possible with some kind of nested SELECT statement,
but last I checked, mysql couldn't do this.

Thanks,

Chris


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to