> i'm doing a join in this query:

Problem is there's no join!

You need to relate the tables in some way, or the db will return every
possible combination of records from all three tables. It doesn't know how
you are relating your records, so it dumps everything back at you.

something like:

WHERE products.cat_ID = category.cat_id

which will join the products table to the category table.

You will need to join all three tables in some way.  If you have a shopping
cart table, you can join the clientID to the selected products, and the
products to the category(s).

Without knowing what fields you have in your tables, it's hard to get more
specific.


> -----Original Message-----
> From: Shawn Regan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 02, 2000 12:25 PM
> To: '[EMAIL PROTECTED]'
> Subject: OT: joining tables
>
>
> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
>
> ------_=_NextPart_001_01BFB452.F8791E40
> Content-Type: text/plain;
>       charset="iso-8859-1"
>
> hey people,
>
> i'm doing a join in this query:
>
> SELECT  CLIENTS.CLIENT_NAME, PRODUCTS.PRODUCT_NAME, CATEGORY.CAT_ID,
> CATEGORY.CATEGORIES
> FROM CLIENTS, PRODUCTS, CATEGORY
> WHERE CLIENTS.CLIENT_NAME='#session.client#'
>
> I have only one record in the database right now for testing. so there is
> only one client. But this query keeps pull out the one client as two
> different clients.
>
> I can't figure it out.
>
> Shawn Regan
>
> ------_=_NextPart_001_01BFB452.F8791E40
> Content-Type: text/html;
>       charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
> <HTML>
> <HEAD>
> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
> charset=3Diso-8859-1">
> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
> 5.5.2650.12">
> <TITLE>OT: joining tables</TITLE>
> </HEAD>
> <BODY>
>
> <P><FONT SIZE=3D2>hey people,</FONT>
> </P>
>
> <P><FONT SIZE=3D2>i'm doing a join in this query:</FONT>
> </P>
>
> <P><FONT SIZE=3D2>SELECT&nbsp; CLIENTS.CLIENT_NAME, =
> PRODUCTS.PRODUCT_NAME, CATEGORY.CAT_ID, CATEGORY.CATEGORIES</FONT>
> <BR><FONT SIZE=3D2>FROM CLIENTS, PRODUCTS, CATEGORY</FONT>
> <BR><FONT SIZE=3D2>WHERE =
> CLIENTS.CLIENT_NAME=3D'#session.client#'</FONT>
> </P>
>
> <P><FONT SIZE=3D2>I have only one record in the database right now for =
> testing. so there is only one client. But this query keeps pull out the =
> one client as two different clients.</FONT></P>
>
> <P><FONT SIZE=3D2>I can't figure it out.</FONT>
> </P>
>
> <P><FONT SIZE=3D2>Shawn Regan</FONT>
> </P>
>
> </BODY>
> </HTML>
> ------_=_NextPart_001_01BFB452.F8791E40--
> ------------------------------------------------------------------
> ------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
_talk or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to