Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8CCna751343 for ; Wed, 12 Sep 2001 08:49:36 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f8CChOx06757 for pgsql-sql@postgresql.org; Wed, 12 Sep 2001 08:43:24 -0400 (EDT) (envelope-from news) From: Arne Weiner X-Newsgroups: comp.databases.postgresql.sql Subject: Re: How do I extract ONE particular field, when multiple table contain Date: Wed, 12 Sep 2001 14:54:23 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 41 Message-ID: <3B9F5AFF.AD76E2A6@gmx.de> References: <6baa8767.0109120106.67f94cf5@posting.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.5 [en] (X11; I; Linux 2.2.18 i586) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200109/59 X-Sequence-Number: 4705 If you refere to more than one table in a query, you have to specify which column to which table belongs. So your query must be Select XID, xi.DENOM, PRICE, FRT, CTID From XItem xi, Category c Where xi.System=1 and xi.Category=c.Index Arne. Olle Wijk wrote: > > 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