Select record in a tabl randomly

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
kevin7
Forum Commoner
Posts: 96
Joined: Fri May 21, 2004 6:54 am

Select record in a tabl randomly

Post by kevin7 »

hmm...
i wanna to display a record which is randomly selected from a table...

what syntax allow me to do so?

tq...
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Code: Select all

SELECT blah FROM table ORDER BY RAND() LIMIT 1
Post Reply