Received: from pinguin.gl.aser.de (pec-151-180.tnt7.b2.uunet.de [149.225.151.180]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8EL9d701826 for ; Fri, 14 Sep 2001 17:09:39 -0400 (EDT) (envelope-from gcg@gl.aser.de) Received: by pinguin.gl.aser.de (Postfix, from userid 1000) id 26D8112BF8; Fri, 14 Sep 2001 23:14:33 +0200 (CEST) Content-Type: text/plain; charset="iso-8859-1" From: Christof Glaser Organization: gl.aser . software engineering . internet service To: olle.wijk@systecon.se (Olle Wijk), pgsql-sql@postgresql.org Subject: Re: How do I extract ONE particular field, when multiple table contain the same field name? Date: Fri, 14 Sep 2001 23:05:21 +0200 X-Mailer: KMail [version 1.3.1] References: <6baa8767.0109120106.67f94cf5@posting.google.com> In-Reply-To: <6baa8767.0109120106.67f94cf5@posting.google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20010914211433.26D8112BF8@pinguin.gl.aser.de> X-Archive-Number: 200109/85 X-Sequence-Number: 4749 On Wednesday, 12. September 2001 11:06, 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' Just write: table.field or table-alias.field instead of just 'field' (like you did already in the WHERE clause): Select XID, xi.DENOM, PRICE, FRT, CTID From XItem xi, Category c Where xi.System=1 and xi.Category=c.Index Christof -- gl.aser . software engineering . internet service http://gl.aser.de/ . Planckstraße 7 . D-39104 Magdeburg