It is a 1 to 1 relationship between them.
Thanks
----- Original Message -----
From: "Hayes, David" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, April 12, 2001 7:21 AM
Subject: RE: SQL Returns


> Is your join correct? Should it, perhaps, be WHERE products.ItemID =
> prodPics.itemID?
>  Is there a 1 to 1 relationship between products and pics?
>
> -----Original Message-----
> From: Alan Koenig [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 12, 2001 11:58 AM
> 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

Reply via email to