h1

Random Output In a Query

December 20, 2007

You can randomize your output in a query using the ORDER BY rand()

Example:

SELECT DISTINCT a.f_user_id, c.f_username,
...
AND b.f_bid_transaction_id is not null
ORDER BY rand()
LIMIT 30

One comment

  1. Ooh, this blog’s going to be helpful Euri! ^_^



Leave a Comment