I have a table, and how can I make a select statement to select a random row. Just any random row in a table. Thanks
select * from yourTable order by rand() limit 1
Please remmber that "order by rand()" is only available for mysql version 3.23+
This might work as well, if you have a numeric field in your table (e.g. id)
SELECT field1, field2, id*0+rand() as random FROM table ORDER BY random LIMIT 1
The same but a little more compact:
SELECT rand(),field1,field2,field3,rand() FROM table ORDER BY 1 LIMIT 1;