Received: from akirason.se.verio.net (akirason.se.verio.net [204.27.64.122]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8ELZn709915 for ; Fri, 14 Sep 2001 17:35:49 -0400 (EDT) (envelope-from jeckermann@verio.net) Received: from beancounter (no-wkstns.gs.verio.net [204.27.67.225]) (authenticated) by akirason.se.verio.net (8.11.4/8.11.4) with ESMTP id f8ELdMI16195; Fri, 14 Sep 2001 16:39:23 -0500 (CDT) (envelope-from jeckermann@verio.net) Message-ID: <02ee01c13d65$2ff1c6d0$279c10ac@INTERNAL> From: "Jeff Eckermann" To: "Olle Wijk" , References: <6baa8767.0109120106.67f94cf5@posting.google.com> Subject: Re: How do I extract ONE particular field, when multiple table contain the same field name? Date: Fri, 14 Sep 2001 16:35:32 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200109/81 X-Sequence-Number: 4736 You need to qualify "DENOM" with the table name: just write "xi.DENOM". I find this to be good general practice when selecting from more than one table. ----- Original Message ----- From: "Olle Wijk" To: Sent: Wednesday, September 12, 2001 4:06 AM Subject: How do I extract ONE particular field, when multiple table contain the same field name? > Hi, > > I am pretty new att using SQL-quires, could anyone help me with this > one: > > I want to do the following SQL-query: > > Select XID, DENOM, PRICE, FRT, CTID From XItem xi, Category c Where > xi.System=1 and xi.Category=c.Index > > the problem is that the field 'DENOM' is present in both table 'XItem' > and > 'Category' (it is a text description field where you explain whatever > you > want). Therefore I get the following complaint when I run the query: > > Error msg: "The specified fiel 'DENOM' could refer to more than one > table listed > in the FROM clause of your SQL-statement" > > The DENOM-field I actually want is the one belonging to the > XItem-table. > I would most appreciate if someone could give me a hint how to alter > the > SELECT-statement above so that it does what I want. > > Regards > > /olw > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > >