Eric J Hoffman wrote: > What is the best way to get a random record from an table that has > frequent changes and updates...best practices or practical advice from > veterans? Randrange between 1 and recordcount won't work pulling a num > and then going against primary id..so somehow to get a "row"?
Depends on your database. In PostgreSQL I prefer to use: SELECT * FROM table ORDER BY Random() LIMIT 1 But in most other databases this doesn't work so I get the entire table and then use the RandRange() trick to show just 1 column. Jochem ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

