Keen wrote:

> I need to run a query and return 10 random records.  I used the following to
> get the records but can have the same random number returned more than once.
> I would like to insure that the 10 records returned are distinct.  Any
> suggestions?  TIA


Why not just return 10 random records? If your database supports this, 
the code below is very nice:

SELECT *
FROM table
ORDER BY Random()
LIMIT 10


Jochem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to