> 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.

CREATE TEMPORARY TABLE temptable TYPE=HEAP SELECT * FROM theTable ORDER BY
RAND() LIMIT 5;
SELECT * FROM temptable ORDER BY date;
DROP TABLE temptable;


---------------------------------------------------------------------
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