SELECT TOP 1 * FROM tablename Order By NEWID()
In SQLServer, the NEWID() function gives the random record.
Cheers
Mike Kear
Windsor, NSW, Australia
AFP Webworks
http://afpwebworks.com
________________________________________
From: Ewok [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 4 August 2004 9:40 AM
To: CF-Talk
Subject: Re: tip of the day
well there are a couple of ways to get a random record...
as long as ou are not using access there is a RAND() function to do it...
something like this if i remember correctly
select * from table order by Rand() limit 1
that SHOULD return 1 random record everytime its ran.
[snip]
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

