it is, prior to SQL 2005 which has a function to do this natively, this is
the standard approach.







"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Andrew Scott
To: CF-Talk
Sent: Thu Mar 22 06:52:36 2007
Subject: Re: How to Random Pick records from a 10k record table via SQL

Not sure how that works Russ, thats not very random?



On 3/22/07, Russ <[EMAIL PROTECTED]> wrote:
>
> Not sure about mysql.  In SQL server I would do something like this:
>
> Select top 20 * from table order by newId()
>
> Russ
>
> > -----Original Message-----
> > From: Michael E. Carluen [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 22, 2007 1:25 AM
> > To: CF-Talk
> > Subject: How to Random Pick records from a 10k record table via SQL
> >
> > Hello All,
> >
> > I am wondering how to randomly pick any 20 records from a table of
> 10,000+
> > records, directly from a cfquery?  Currently using mySQL.
> >
> > Any suggestions will be appreciated.
> >
> > Michael
> >
> >
> >
> >
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new features.
http://www.adobe.com/products/coldfusion?sdid=RVJR

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273344
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to