[advertisement]

Interested in putting your ad here?

Blog Entry

29th September 2009
Send to twitter Send to Facebook

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.

Blog archives

+ About this blog