X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 9A883B4388C for ; Mon, 7 Jul 2003 15:11:20 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 13410-08 for ; Mon, 7 Jul 2003 12:11:08 -0300 (ADT) Received: from stan.ringways.co.uk (hub.ringways.co.uk [213.38.87.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3D18AB438A3 for ; Mon, 7 Jul 2003 12:10:57 -0300 (ADT) Received: from gary.ringways.co.uk ([10.1.1.2]) by stan.ringways.co.uk with esmtp (Exim 3.22 #1) id 19ZXd6-0001qm-00 for pgsql-sql@postgresql.org; Mon, 07 Jul 2003 16:10:12 +0100 Content-Type: text/plain; charset="iso-8859-1" From: Gary Stainburn Organization: Ringways Garages Ltd To: pgsql-sql@postgresql.org Subject: Re: Concat and view - Re: create view error Date: Mon, 7 Jul 2003 16:10:25 +0100 User-Agent: KMail/1.4.3 References: <200307071240.23936.gary.stainburn@ringways.co.uk> <200307071401.38483.gary.stainburn@ringways.co.uk> <200307071534.20970.dev@archonet.com> In-Reply-To: <200307071534.20970.dev@archonet.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200307071610.25690.gary.stainburn@ringways.co.uk> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/66 X-Sequence-Number: 14180 On Monday 07 Jul 2003 3:34 pm, Richard Huxton wrote: > On Monday 07 Jul 2003 2:12 pm, Gary Stainburn wrote: > > I've managed to get the view I wanted by using sub-selects - as shown > > below, but I now have the 'lid' field showing in the resulting view three > > times (as lid, lnid and lnaid). How can I remove lnid and lnaid from the > > result? > > > > create view loco_dets as > > select * from locos l > > left outer join > > [snip] > > Don't do "select *" do "select field_a,field_b..." - the * doesn't just > refer to the locos table. Sorry if I didn't make myself plain enough, but I had create view loco_dets as select * from locos l -- includes lid which I want left outer join (select lnid, lnumber.......) ln on ln.lnid = l.lid ....... The problem is that I have to have lnid in the sub-select to allow the 'on' clause to work, but I don't want lnid to appear in the resulting view. -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000