Yup. That's much better. Let the DB do all the work. :)
--Jeff
Charlie Griefer wrote:
> SELECT TOP 1
> field1,
> field2,
> ...
> FROM
> table
> WHERE
> public = 1
> ORDER BY
> newID()
>
> ----- Original Message -----
> From: "Dustin Snell [Network Automation, Inc]"
> <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 20, 2004 2:21 PM
> Subject: Retrieve a random record from a database
>
> > We have a database with a bunch of customer testimonials in it. Records
> can
> > be added to it at anytime. Some are marked public and some or not. Does
> > anyone know how I could pull a single record randomly from the database
> > using MSSQL2000 and CF6.1 for display on the website - but only out
> of the
> > records where public=1? I am just not sure how to structure the query to
> do
> > this.
> >
> > Thanks in advance.
> >
> >
> > Dustin Snell
> > Network Automation, Inc
> > www.networkautomation.com
> >
> >
> >
> >
> >
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- Proper Case UDF Wes
- Re: Proper Case UDF Bryan Stevenson
- RE: Proper Case UDF Barney Boisvert
- Re: Proper Case UDF Charlie Griefer
- Retrieve a random record f... Dustin Snell [Network Automation, Inc]
- Re: Retrieve a random ... Jeff Langevin
- Re: Retrieve a ran... Charlie Griefer
- RE: Retrieve ... James Smith
- Re: Retrieve a random ... Charlie Griefer
- Re: Retrieve a ran... Jeff Langevin
- Re: Retrieve a random ... JediHomer
- Re: Proper Case UDF Robert Munn