David Fallon wrote:
>
> Is it possible to SELECT a random recordset out of a database? If so, what's
> the syntax? (I want to get a random selection of 5 items from a table).
>
> I'm not subscribed to the list, so please reply directly to me.
Hi David
I've not tested this myself.
You have to use 3.23.3 for this to work (which I currently don't use):
SELECT * FROM table ORDER BY RND() LIMIT 5;
Or you can add a column and fill it randomly to sort after this (works with 3.22.xx
versions):
ALTER TABLE table ADD random DOUBLE;
UPDATE table SET random=RND();
SELECT * FROM table ORDER BY random LIMIT 5;
Tschau
Christian