From lcofield@box-works.com Mon Oct 6 16:28:18 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3FE14D1B506 for ; Mon, 6 Oct 2003 16:28:18 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 02349-01 for ; Mon, 6 Oct 2003 13:27:28 -0300 (ADT) Received: from ns.lanterm.net (unknown [208.187.178.11]) by svr1.postgresql.org (Postfix) with ESMTP id 65E1AD1B4EC for ; Mon, 6 Oct 2003 13:27:12 -0300 (ADT) Received: from Louise ([208.187.178.2]) by ns.lanterm.net (8.11.6/8.11.6) with ESMTP id h96FKLs05291 for ; Mon, 6 Oct 2003 09:20:21 -0600 From: "Louise Cofield" To: Subject: Multiple table join Date: Mon, 6 Oct 2003 10:26:59 -0600 Message-ID: <002d01c38c26$aaa76990$7801a8c0@Louise> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002E_01C38BF4.600CF990" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=HTML_70_80 X-Spam-Level: X-Archive-Number: 200310/68 X-Sequence-Number: 15468 This is a multi-part message in MIME format. ------=_NextPart_000_002E_01C38BF4.600CF990 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Greetings, SQL gurus! I am attempting to select fields Location and Item_Num from table A where A.Location = B.Location, AND select Item_Description from table C, where A.Item_Num = C.Item_Num. Any help would be appreciated. Louise ------=_NextPart_000_002E_01C38BF4.600CF990 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Greetings, SQL gurus!

 

I am attempting to select fields Location and Item_Num f= rom table A where A.Location =3D B.Location,

AND

select Item_Description from table C, where A.Item_Num = =3D C.Item_Num.

 

 

Any help would be appreciated.

 

Louise

 

 

------=_NextPart_000_002E_01C38BF4.600CF990-- From lcofield@box-works.com Mon Oct 6 16:36:27 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 1BB0DD1B548 for ; Mon, 6 Oct 2003 16:36:27 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 03253-01 for ; Mon, 6 Oct 2003 13:35:37 -0300 (ADT) Received: from ns.lanterm.net (unknown [208.187.178.11]) by svr1.postgresql.org (Postfix) with ESMTP id 4085FD1B52E for ; Mon, 6 Oct 2003 13:35:36 -0300 (ADT) Received: from Louise ([208.187.178.2]) by ns.lanterm.net (8.11.6/8.11.6) with ESMTP id h96FSxs05624; Mon, 6 Oct 2003 09:28:59 -0600 From: "Louise Cofield" To: "'Bruno Wolff III'" Cc: Subject: Re: Multiple table join Date: Mon, 6 Oct 2003 10:35:37 -0600 Message-ID: <003401c38c27$df7fbe50$7801a8c0@Louise> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 In-Reply-To: <20031006163804.GA27925@wolff.to> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/72 X-Sequence-Number: 15472 That was waaaaay too simple -- thank you! -----Original Message----- From: Bruno Wolff III [mailto:bruno@wolff.to] Sent: Monday, October 06, 2003 10:38 AM To: Louise Cofield Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] Multiple table join On Mon, Oct 06, 2003 at 10:26:59 -0600, Louise Cofield wrote: > > I am attempting to select fields Location and Item_Num from table A > where A.Location = B.Location, > > AND > > select Item_Description from table C, where A.Item_Num = C.Item_Num. Just list all three tables in the from item list and include both conditions in the where clause (connected by and). If there is more to your problem than this, you should supply more details. From bruno@wolff.to Mon Oct 6 16:31:30 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 73DB7D1B51E for ; Mon, 6 Oct 2003 16:31:30 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 00980-06 for ; Mon, 6 Oct 2003 13:30:41 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 37764D1B4FF for ; Mon, 6 Oct 2003 13:30:40 -0300 (ADT) Received: (qmail 27985 invoked by uid 500); 6 Oct 2003 16:38:04 -0000 Date: Mon, 6 Oct 2003 11:38:04 -0500 From: Bruno Wolff III To: Louise Cofield Cc: pgsql-sql@postgresql.org Subject: Re: Multiple table join Message-ID: <20031006163804.GA27925@wolff.to> Mail-Followup-To: Louise Cofield , pgsql-sql@postgresql.org References: <002d01c38c26$aaa76990$7801a8c0@Louise> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002d01c38c26$aaa76990$7801a8c0@Louise> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/69 X-Sequence-Number: 15469 On Mon, Oct 06, 2003 at 10:26:59 -0600, Louise Cofield wrote: > > I am attempting to select fields Location and Item_Num from table A > where A.Location = B.Location, > > AND > > select Item_Description from table C, where A.Item_Num = C.Item_Num. Just list all three tables in the from item list and include both conditions in the where clause (connected by and). If there is more to your problem than this, you should supply more details. From dan@langille.org Mon Oct 6 16:39:03 2003 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0F356D1B4F6 for ; Mon, 6 Oct 2003 16:39:03 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 00980-10 for ; Mon, 6 Oct 2003 13:38:16 -0300 (ADT) Received: from bast.unixathome.org (bast.unixathome.org [66.11.174.150]) by svr1.postgresql.org (Postfix) with ESMTP id 700AED1B52D for ; Mon, 6 Oct 2003 13:38:15 -0300 (ADT) Received: from wocker (wocker.unixathome.org [192.168.0.99]) by bast.unixathome.org (Postfix) with ESMTP id E37F53D28; Mon, 6 Oct 2003 12:37:38 -0400 (EDT) From: "Dan Langille" To: "Louise Cofield" Date: Mon, 06 Oct 2003 12:39:43 -0400 MIME-Version: 1.0 Subject: Re: Multiple table join Cc: pgsql-sql@postgresql.org Message-ID: <3F81628F.2672.587C7E11@localhost> In-reply-to: <002d01c38c26$aaa76990$7801a8c0@Louise> X-mailer: Pegasus Mail for Windows (v4.02a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/73 X-Sequence-Number: 15473 On 6 Oct 2003 at 10:26, Louise Cofield wrote: > I am attempting to select fields Location and Item_Num from table A > where A.Location = B.Location, > > AND > > select Item_Description from table C, where A.Item_Num = C.Item_Num. Try: select Location, Item_Num from table A, B, C where A.Location = B.Location and A.Item_Num = C.Item_Num -- Dan Langille : http://www.langille.org/