> Someone posted this idea a while back.
>
> SELECT TOP 1 employee_id, newid() as new_id
> FROM yourtable
>
> CC

That pulls the first1 record from the database. This will pull the first
1000 records...

SELECT TOP 1000 employee_id, newid() as new_id
FROM yourtable

I need a random record. Isn't there a rand funcion in SQL.... perhaps
something like....

SELECT Rand(employee_id) as RandomRecord
FROM yourtable

Seems like there's gotta be a simple solution.

Thanks,
Steve




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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