God bless you, MySQL. You’re one crazy DBMS. You can actually ORDER BY the RAND() function to get a dataset ordered randomly.
SELECT * FROM T ORDER BY RAND() LIMIT 1;
This selects a random row from table T. Couldn’t be easier.
God bless you, MySQL. You’re one crazy DBMS. You can actually ORDER BY the RAND() function to get a dataset ordered randomly.
SELECT * FROM T ORDER BY RAND() LIMIT 1;
This selects a random row from table T. Couldn’t be easier.
💬 Share a response to this post