first thing's first. please post in plain text instead of HTML. it makes
it MUCH easier to help you.
second.
you're querying from three different tables. since you only specify one in
your where clause, you get what's called a "cartesian product". what you
need to do is make sure all the tables from which you query are joined
appropriately.
ex. (i'm assuming the primary keys are the same in each table, and that
products is a subtable of category.)
WHERE CLIENTS.CLIENT_NAME='#session.client#' AND
PRODUCTS.client_name= CLIENTS.client_name AND
CATEGORY.category_id = products.category_id.
does this make sense?
Chris Olive
DOHRS Website Administrator
[EMAIL PROTECTED]
-----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 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.