X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A8000D1D269 for ; Wed, 10 Mar 2004 22:51:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 17482-02 for ; Wed, 10 Mar 2004 18:51:13 -0400 (AST) Received: from mta07-svc.ntlworld.com (mta07-svc.ntlworld.com [62.253.162.47]) by svr1.postgresql.org (Postfix) with ESMTP id 9C9B8D1D17D for ; Wed, 10 Mar 2004 18:51:10 -0400 (AST) Received: from apple.at.home ([80.1.223.30]) by mta07-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20040310225117.WCQC25572.mta07-svc.ntlworld.com@apple.at.home> for ; Wed, 10 Mar 2004 22:51:17 +0000 Received: from localhost (localhost [127.0.0.1]) by apple.at.home (Postfix) with ESMTP id DA0131EF24 for ; Wed, 10 Mar 2004 22:51:57 +0000 (GMT) Received: from orange.keep-trying.com (orange.at.home [192.168.5.30]) by apple.at.home (Postfix) with ESMTP id 4ADE51EEEE for ; Wed, 10 Mar 2004 22:51:56 +0000 (GMT) Message-Id: <6.0.0.22.0.20040310224936.01ccda30@192.168.5.1> X-Sender: richard@192.168.5.1 X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22 Date: Wed, 10 Mar 2004 22:51:03 +0000 To: pgsql-sql@postgresql.org From: Richard Grosse Subject: Re: Converting query to view - duplicate fields - solved In-Reply-To: <20040309181341.S12789@megazone.bigpanda.com> References: <6.0.0.22.0.20040309223517.0351e328@192.168.5.1> <20040309181341.S12789@megazone.bigpanda.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd 0.1 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/124 X-Sequence-Number: 17223 At 02:17 10/03/2004, you wrote: >On Tue, 9 Mar 2004, Richard Grosse wrote: > > > Trying to convert the query below to a view. The problem is > > despite it working as a query when trying to save it as a > > view the database returns the error that the field tablealias.cmpname > > is duplicated. (Which it is and has to be) > >You're going to need to use column aliases to alias (for example) >tbldeliver.cmpname, tblsender.cmpname, tblhaulier.cmpname to different >aliases in the view, perhaps >"tbldeliver.cmpname" "tblsender.cmpname" and "tblhaulier.cmpname" >(note the double quotes). Great just what I needed to know. Works fine now :-) Thanks Richard