Not too sure to be honest...

I found it from a site after I was using a stored procedure and a loop (not
the best code in the world)

But basically (AFAIK) it says, get me the top 10 items from table foo and
order these by a random number.  Thus if you call it again then the number
you are ordering is different, hence the random rows returned.


HTH



-----Original Message-----
From: admin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 27, 2003 10:02
To: CF-Talk
Subject: Re: ot - random sql select


Thanks mike I'll give that a try - but out of interest what does that code
really mean ? - ok - so I'm an idiot in sql !

Cheers

Richard

----- Original Message ----- 
From: "Mike Townend" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, August 27, 2003 1:28 AM
Subject: RE: ot - random sql select


> If you are using SQLServer 2K (not sure if it works in 7) you could 
> use
>
> SELECT TOP 10 *
> FROM Foo
> ORDER BY NewID()
>
>
> HTH
>
>
>
> -----Original Message-----
> From: admin [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 27, 2003 07:11
> To: CF-Talk
> Subject: ot - random sql select
>
>
> is there an easy way to select say 10 records at random from an sql 
> table
?
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Reply via email to