Instead of using (cfoutput Query="queryname") try just cfoutput and use the
queryname.outputvarible (#queryname.columname#). This will only output the
first line no matter how many records are selected.
Hope this helps! CW
-----Original Message-----
From: Jeffry Houser [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 12, 2001 5:54 PM
To: CF-Talk
Subject: Re: SQL Returns
If you are using DISTINCT you will not get 14 identical returns for each
record. There must be something else that is different. If you want to
show us your table structure, and perhaps some sample data we might be able
to offer further help.
At 08:21 AM 04/12/2001 -1000, you wrote:
>That did not help, now I am getting 14 returns for each record. Now I am
in
>confusion.
>Is there another way for me to return just one record. Do I need to refine
>my where clause?
>TIA
>
>
>----- Original Message -----
>From: "Bob Silverberg" <[EMAIL PROTECTED]>
>To: "CF-Talk" <[EMAIL PROTECTED]>
>Sent: Thursday, April 12, 2001 7:24 AM
>Subject: RE: SQL Returns
>
>
> > Well, one way it to use the DISTINCT keyword. Change your statement
from:
> >
> > SELECT Products.ItemID, etc.
> >
> > to
> >
> > SELECT DISTINCT Products.ItemID, etc.
> >
> > .... but I'm not sure if that will give you what you want.
> >
> > Give it a try and see what the result set looks like.
> >
> > Bob
> >
> > -----Original Message-----
> > From: Alan Koenig [mailto:[EMAIL PROTECTED]]
> > Sent: April 12, 2001 12:58 PM
> > To: CF-Talk
> > Subject: SQL Returns
> >
> >
> > I would like to refine my sql searches down. From the following sql
> > statement I am recieving up to 12 returns of the same record. How can I
> > make this so that there is only 1 return for each record?
> > <cfquery datasource="#datasource#" name="prodpage">
> > SELECT Products.ItemID,
> > Products.SKU, Products.ItemName,
> > Products.CategoryID,
> > Products.SubCatID,
> > Products.S_Description,
> > Products.Description,
> > Products.Price,
> > Products.Weight,
> > Products.A1,
> > Products.A1Vals,
> > Products.A2,
> > Products.A2Vals,
> > Products.Units,
> > Products.Layout,
> > Products.Key_Word,
> > ProdPics.PicID,
> > ProdPics.ItemPic,
> > ProdPics.ItemPicLB,
> > ProdPics.ItemPicF,
> > ProdPics.ItemPicB
> > FROM Products, ProdPics
> > WHERE Products.ItemID = ProdPics.PicID
> > AND Description LIKE '%#form.keyword#%'
> > OR ItemName LIKE '%#form.keyword#%'
> > AND ItemID > 1
> > ORDER BY ItemName
> > </cfquery>
> >
> > TIA
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists