At 06:57 AM 04/12/2001 -1000, you wrote:
>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,
Add a DISTINCT here, so it is:
SELECT DISTINCT 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
Should this be: Products.ItemID = ProdPics.ItemID ?
Just some guesses, without knowing the table structure intimately....
> AND Description LIKE '%#form.keyword#%'
> OR ItemName LIKE '%#form.keyword#%'
> AND ItemID > 1
> ORDER BY ItemName
> </cfquery>
Jeffry Houser | mailto:[EMAIL PROTECTED]
AIM: Reboog711 | ICQ: 5246969 | Phone: 860-229-2781
--
Instant ColdFusion 5.0 | ISBN: 0-07-213238-8
Due out June 2001
--
DotComIt, LLC
database driven web data using ColdFusion, Lotus Notes/Domino
--
Half of the Alternative Folk Duo called Far Cry Fly
http://www.farcryfly.com | http://www.mp3.com/FarCryFly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists